diff options
Diffstat (limited to 'net/packet')
| -rw-r--r-- | net/packet/Kconfig | 26 | ||||
| -rw-r--r-- | net/packet/af_packet.c | 6 |
2 files changed, 32 insertions, 0 deletions
diff --git a/net/packet/Kconfig b/net/packet/Kconfig new file mode 100644 index 000000000000..34ff93ff894d --- /dev/null +++ b/net/packet/Kconfig | |||
| @@ -0,0 +1,26 @@ | |||
| 1 | # | ||
| 2 | # Packet configuration | ||
| 3 | # | ||
| 4 | |||
| 5 | config PACKET | ||
| 6 | tristate "Packet socket" | ||
| 7 | ---help--- | ||
| 8 | The Packet protocol is used by applications which communicate | ||
| 9 | directly with network devices without an intermediate network | ||
| 10 | protocol implemented in the kernel, e.g. tcpdump. If you want them | ||
| 11 | to work, choose Y. | ||
| 12 | |||
| 13 | To compile this driver as a module, choose M here: the module will | ||
| 14 | be called af_packet. | ||
| 15 | |||
| 16 | If unsure, say Y. | ||
| 17 | |||
| 18 | config PACKET_MMAP | ||
| 19 | bool "Packet socket: mmapped IO" | ||
| 20 | depends on PACKET | ||
| 21 | help | ||
| 22 | If you say Y here, the Packet protocol driver will use an IO | ||
| 23 | mechanism that results in faster communication. | ||
| 24 | |||
| 25 | If unsure, say N. | ||
| 26 | |||
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index 0269616e75a1..c9d5980aa4de 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
| @@ -274,6 +274,9 @@ static int packet_rcv_spkt(struct sk_buff *skb, struct net_device *dev, struct | |||
| 274 | dst_release(skb->dst); | 274 | dst_release(skb->dst); |
| 275 | skb->dst = NULL; | 275 | skb->dst = NULL; |
| 276 | 276 | ||
| 277 | /* drop conntrack reference */ | ||
| 278 | nf_reset(skb); | ||
| 279 | |||
| 277 | spkt = (struct sockaddr_pkt*)skb->cb; | 280 | spkt = (struct sockaddr_pkt*)skb->cb; |
| 278 | 281 | ||
| 279 | skb_push(skb, skb->data-skb->mac.raw); | 282 | skb_push(skb, skb->data-skb->mac.raw); |
| @@ -517,6 +520,9 @@ static int packet_rcv(struct sk_buff *skb, struct net_device *dev, struct packe | |||
| 517 | dst_release(skb->dst); | 520 | dst_release(skb->dst); |
| 518 | skb->dst = NULL; | 521 | skb->dst = NULL; |
| 519 | 522 | ||
| 523 | /* drop conntrack reference */ | ||
| 524 | nf_reset(skb); | ||
| 525 | |||
| 520 | spin_lock(&sk->sk_receive_queue.lock); | 526 | spin_lock(&sk->sk_receive_queue.lock); |
| 521 | po->stats.tp_packets++; | 527 | po->stats.tp_packets++; |
| 522 | __skb_queue_tail(&sk->sk_receive_queue, skb); | 528 | __skb_queue_tail(&sk->sk_receive_queue, skb); |
