| .. | .. |
|---|
| 24 | 24 | unsigned int bind_inany:1; |
|---|
| 25 | 25 | unsigned int has_conns:1; |
|---|
| 26 | 26 | struct bpf_prog __rcu *prog; /* optional BPF sock selector */ |
|---|
| 27 | | - struct sock *socks[0]; /* array of sock pointers */ |
|---|
| 27 | + struct sock *socks[]; /* array of sock pointers */ |
|---|
| 28 | 28 | }; |
|---|
| 29 | 29 | |
|---|
| 30 | 30 | extern int reuseport_alloc(struct sock *sk, bool bind_inany); |
|---|
| .. | .. |
|---|
| 36 | 36 | struct sk_buff *skb, |
|---|
| 37 | 37 | int hdr_len); |
|---|
| 38 | 38 | extern int reuseport_attach_prog(struct sock *sk, struct bpf_prog *prog); |
|---|
| 39 | +extern int reuseport_detach_prog(struct sock *sk); |
|---|
| 39 | 40 | |
|---|
| 40 | | -static inline bool reuseport_has_conns(struct sock *sk, bool set) |
|---|
| 41 | +static inline bool reuseport_has_conns(struct sock *sk) |
|---|
| 41 | 42 | { |
|---|
| 42 | 43 | struct sock_reuseport *reuse; |
|---|
| 43 | 44 | bool ret = false; |
|---|
| 44 | 45 | |
|---|
| 45 | 46 | rcu_read_lock(); |
|---|
| 46 | 47 | reuse = rcu_dereference(sk->sk_reuseport_cb); |
|---|
| 47 | | - if (reuse) { |
|---|
| 48 | | - if (set) |
|---|
| 49 | | - reuse->has_conns = 1; |
|---|
| 50 | | - ret = reuse->has_conns; |
|---|
| 51 | | - } |
|---|
| 48 | + if (reuse && reuse->has_conns) |
|---|
| 49 | + ret = true; |
|---|
| 52 | 50 | rcu_read_unlock(); |
|---|
| 53 | 51 | |
|---|
| 54 | 52 | return ret; |
|---|
| 55 | 53 | } |
|---|
| 56 | 54 | |
|---|
| 57 | | -int reuseport_get_id(struct sock_reuseport *reuse); |
|---|
| 55 | +void reuseport_has_conns_set(struct sock *sk); |
|---|
| 58 | 56 | |
|---|
| 59 | 57 | #endif /* _SOCK_REUSEPORT_H */ |
|---|