Message ID | 1449096887-23017-83-git-send-email-kamal@canonical.com |
---|---|
State | New |
Headers | show |
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 7f63613..b4cb15b 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1288,10 +1288,10 @@ static void __fanout_unlink(struct sock *sk, struct packet_sock *po) static bool match_fanout_group(struct packet_type *ptype, struct sock * sk) { - if (ptype->af_packet_priv == (void*)((struct packet_sock *)sk)->fanout) - return true; + if (sk->sk_family != PF_PACKET) + return false; - return false; + return ptype->af_packet_priv == pkt_sk(sk)->fanout; } static int fanout_add(struct sock *sk, u16 id, u16 type_flags)