diff options
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 226b2cdfc339..fe0912f161ce 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -966,7 +966,7 @@ static void *packet_current_rx_frame(struct packet_sock *po, | |||
966 | default: | 966 | default: |
967 | WARN(1, "TPACKET version not supported\n"); | 967 | WARN(1, "TPACKET version not supported\n"); |
968 | BUG(); | 968 | BUG(); |
969 | return 0; | 969 | return NULL; |
970 | } | 970 | } |
971 | } | 971 | } |
972 | 972 | ||
@@ -1161,6 +1161,14 @@ static void __fanout_unlink(struct sock *sk, struct packet_sock *po) | |||
1161 | spin_unlock(&f->lock); | 1161 | spin_unlock(&f->lock); |
1162 | } | 1162 | } |
1163 | 1163 | ||
1164 | bool match_fanout_group(struct packet_type *ptype, struct sock * sk) | ||
1165 | { | ||
1166 | if (ptype->af_packet_priv == (void*)((struct packet_sock *)sk)->fanout) | ||
1167 | return true; | ||
1168 | |||
1169 | return false; | ||
1170 | } | ||
1171 | |||
1164 | static int fanout_add(struct sock *sk, u16 id, u16 type_flags) | 1172 | static int fanout_add(struct sock *sk, u16 id, u16 type_flags) |
1165 | { | 1173 | { |
1166 | struct packet_sock *po = pkt_sk(sk); | 1174 | struct packet_sock *po = pkt_sk(sk); |
@@ -1213,6 +1221,7 @@ static int fanout_add(struct sock *sk, u16 id, u16 type_flags) | |||
1213 | match->prot_hook.dev = po->prot_hook.dev; | 1221 | match->prot_hook.dev = po->prot_hook.dev; |
1214 | match->prot_hook.func = packet_rcv_fanout; | 1222 | match->prot_hook.func = packet_rcv_fanout; |
1215 | match->prot_hook.af_packet_priv = match; | 1223 | match->prot_hook.af_packet_priv = match; |
1224 | match->prot_hook.id_match = match_fanout_group; | ||
1216 | dev_add_pack(&match->prot_hook); | 1225 | dev_add_pack(&match->prot_hook); |
1217 | list_add(&match->list, &fanout_list); | 1226 | list_add(&match->list, &fanout_list); |
1218 | } | 1227 | } |
@@ -1824,7 +1833,6 @@ static void tpacket_destruct_skb(struct sk_buff *skb) | |||
1824 | 1833 | ||
1825 | if (likely(po->tx_ring.pg_vec)) { | 1834 | if (likely(po->tx_ring.pg_vec)) { |
1826 | ph = skb_shinfo(skb)->destructor_arg; | 1835 | ph = skb_shinfo(skb)->destructor_arg; |
1827 | BUG_ON(__packet_get_status(po, ph) != TP_STATUS_SENDING); | ||
1828 | BUG_ON(atomic_read(&po->tx_ring.pending) == 0); | 1836 | BUG_ON(atomic_read(&po->tx_ring.pending) == 0); |
1829 | atomic_dec(&po->tx_ring.pending); | 1837 | atomic_dec(&po->tx_ring.pending); |
1830 | __packet_set_status(po, ph, TP_STATUS_AVAILABLE); | 1838 | __packet_set_status(po, ph, TP_STATUS_AVAILABLE); |