aboutsummaryrefslogtreecommitdiffstats
path: root/net/packet/af_packet.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/packet/af_packet.c')
-rw-r--r--net/packet/af_packet.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
index 404c9735aee9..8167aecc1594 100644
--- a/net/packet/af_packet.c
+++ b/net/packet/af_packet.c
@@ -704,6 +704,10 @@ static void prb_retire_rx_blk_timer_expired(unsigned long data)
704 704
705 if (pkc->last_kactive_blk_num == pkc->kactive_blk_num) { 705 if (pkc->last_kactive_blk_num == pkc->kactive_blk_num) {
706 if (!frozen) { 706 if (!frozen) {
707 if (!BLOCK_NUM_PKTS(pbd)) {
708 /* An empty block. Just refresh the timer. */
709 goto refresh_timer;
710 }
707 prb_retire_current_block(pkc, po, TP_STATUS_BLK_TMO); 711 prb_retire_current_block(pkc, po, TP_STATUS_BLK_TMO);
708 if (!prb_dispatch_next_block(pkc, po)) 712 if (!prb_dispatch_next_block(pkc, po))
709 goto refresh_timer; 713 goto refresh_timer;
@@ -804,7 +808,11 @@ static void prb_close_block(struct tpacket_kbdq_core *pkc1,
804 h1->ts_last_pkt.ts_sec = last_pkt->tp_sec; 808 h1->ts_last_pkt.ts_sec = last_pkt->tp_sec;
805 h1->ts_last_pkt.ts_nsec = last_pkt->tp_nsec; 809 h1->ts_last_pkt.ts_nsec = last_pkt->tp_nsec;
806 } else { 810 } else {
807 /* Ok, we tmo'd - so get the current time */ 811 /* Ok, we tmo'd - so get the current time.
812 *
813 * It shouldn't really happen as we don't close empty
814 * blocks. See prb_retire_rx_blk_timer_expired().
815 */
808 struct timespec ts; 816 struct timespec ts;
809 getnstimeofday(&ts); 817 getnstimeofday(&ts);
810 h1->ts_last_pkt.ts_sec = ts.tv_sec; 818 h1->ts_last_pkt.ts_sec = ts.tv_sec;
@@ -1355,14 +1363,14 @@ static int packet_rcv_fanout(struct sk_buff *skb, struct net_device *dev,
1355 return 0; 1363 return 0;
1356 } 1364 }
1357 1365
1366 if (fanout_has_flag(f, PACKET_FANOUT_FLAG_DEFRAG)) {
1367 skb = ip_check_defrag(skb, IP_DEFRAG_AF_PACKET);
1368 if (!skb)
1369 return 0;
1370 }
1358 switch (f->type) { 1371 switch (f->type) {
1359 case PACKET_FANOUT_HASH: 1372 case PACKET_FANOUT_HASH:
1360 default: 1373 default:
1361 if (fanout_has_flag(f, PACKET_FANOUT_FLAG_DEFRAG)) {
1362 skb = ip_check_defrag(skb, IP_DEFRAG_AF_PACKET);
1363 if (!skb)
1364 return 0;
1365 }
1366 idx = fanout_demux_hash(f, skb, num); 1374 idx = fanout_demux_hash(f, skb, num);
1367 break; 1375 break;
1368 case PACKET_FANOUT_LB: 1376 case PACKET_FANOUT_LB: