diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-18 06:21:26 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-10-18 06:21:26 +0200 |
commit | 55b333253d5bcafbe187b50474e40789301c53c6 (patch) | |
tree | dbea170b01196473c95d3d558bfce00bc17187fe /net/core/sock.c | |
parent | [MAC80211]: only honor IW_SCAN_THIS_ESSID in STA, IBSS, and AP modes (diff) | |
download | linux-55b333253d5bcafbe187b50474e40789301c53c6.tar.xz linux-55b333253d5bcafbe187b50474e40789301c53c6.zip |
[NET]: Introduce the sk_detach_filter() call
Filter is attached in a separate function, so do the
same for filter detaching.
This also removes one variable sock_setsockopt().
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core/sock.c')
-rw-r--r-- | net/core/sock.c | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/net/core/sock.c b/net/core/sock.c index d45ecdccc6a1..07101381b8b7 100644 --- a/net/core/sock.c +++ b/net/core/sock.c @@ -428,7 +428,6 @@ int sock_setsockopt(struct socket *sock, int level, int optname, char __user *optval, int optlen) { struct sock *sk=sock->sk; - struct sk_filter *filter; int val; int valbool; struct linger ling; @@ -652,16 +651,7 @@ set_rcvbuf: break; case SO_DETACH_FILTER: - rcu_read_lock_bh(); - filter = rcu_dereference(sk->sk_filter); - if (filter) { - rcu_assign_pointer(sk->sk_filter, NULL); - sk_filter_release(sk, filter); - rcu_read_unlock_bh(); - break; - } - rcu_read_unlock_bh(); - ret = -ENONET; + ret = sk_detach_filter(sk); break; case SO_PASSSEC: |