Message ID | 1451949801-27684-1-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 71d671c..d0f6b03 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c @@ -1500,10 +1500,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)