diff options
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r-- | net/packet/af_packet.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c index e52a44785681..9cfe2e1dd8b5 100644 --- a/net/packet/af_packet.c +++ b/net/packet/af_packet.c | |||
@@ -785,6 +785,7 @@ static void prb_close_block(struct tpacket_kbdq_core *pkc1, | |||
785 | 785 | ||
786 | struct tpacket3_hdr *last_pkt; | 786 | struct tpacket3_hdr *last_pkt; |
787 | struct tpacket_hdr_v1 *h1 = &pbd1->hdr.bh1; | 787 | struct tpacket_hdr_v1 *h1 = &pbd1->hdr.bh1; |
788 | struct sock *sk = &po->sk; | ||
788 | 789 | ||
789 | if (po->stats.stats3.tp_drops) | 790 | if (po->stats.stats3.tp_drops) |
790 | status |= TP_STATUS_LOSING; | 791 | status |= TP_STATUS_LOSING; |
@@ -809,6 +810,8 @@ static void prb_close_block(struct tpacket_kbdq_core *pkc1, | |||
809 | /* Flush the block */ | 810 | /* Flush the block */ |
810 | prb_flush_block(pkc1, pbd1, status); | 811 | prb_flush_block(pkc1, pbd1, status); |
811 | 812 | ||
813 | sk->sk_data_ready(sk); | ||
814 | |||
812 | pkc1->kactive_blk_num = GET_NEXT_PRB_BLK_NUM(pkc1); | 815 | pkc1->kactive_blk_num = GET_NEXT_PRB_BLK_NUM(pkc1); |
813 | } | 816 | } |
814 | 817 | ||
@@ -2052,12 +2055,12 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev, | |||
2052 | smp_wmb(); | 2055 | smp_wmb(); |
2053 | #endif | 2056 | #endif |
2054 | 2057 | ||
2055 | if (po->tp_version <= TPACKET_V2) | 2058 | if (po->tp_version <= TPACKET_V2) { |
2056 | __packet_set_status(po, h.raw, status); | 2059 | __packet_set_status(po, h.raw, status); |
2057 | else | 2060 | sk->sk_data_ready(sk); |
2061 | } else { | ||
2058 | prb_clear_blk_fill_status(&po->rx_ring); | 2062 | prb_clear_blk_fill_status(&po->rx_ring); |
2059 | 2063 | } | |
2060 | sk->sk_data_ready(sk); | ||
2061 | 2064 | ||
2062 | drop_n_restore: | 2065 | drop_n_restore: |
2063 | if (skb_head != skb->data && skb_shared(skb)) { | 2066 | if (skb_head != skb->data && skb_shared(skb)) { |
@@ -2514,7 +2517,7 @@ static int packet_snd(struct socket *sock, struct msghdr *msg, size_t len) | |||
2514 | err = -EINVAL; | 2517 | err = -EINVAL; |
2515 | if (sock->type == SOCK_DGRAM) { | 2518 | if (sock->type == SOCK_DGRAM) { |
2516 | offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len); | 2519 | offset = dev_hard_header(skb, dev, ntohs(proto), addr, NULL, len); |
2517 | if (unlikely(offset) < 0) | 2520 | if (unlikely(offset < 0)) |
2518 | goto out_free; | 2521 | goto out_free; |
2519 | } else { | 2522 | } else { |
2520 | if (ll_header_truncated(dev, len)) | 2523 | if (ll_header_truncated(dev, len)) |