]> Pileus Git - ~andy/linux/blobdiff - net/packet/af_packet.c
packet: restore packet statistics tp_packets to include drops
[~andy/linux] / net / packet / af_packet.c
index 4b66c752eae5d99b2bfe5fa7832a1301d20519ef..75c8bbf598c86b54b6160d88d1d1177ce04426b5 100644 (file)
@@ -3259,9 +3259,11 @@ static int packet_getsockopt(struct socket *sock, int level, int optname,
 
                if (po->tp_version == TPACKET_V3) {
                        lv = sizeof(struct tpacket_stats_v3);
+                       st.stats3.tp_packets += st.stats3.tp_drops;
                        data = &st.stats3;
                } else {
                        lv = sizeof(struct tpacket_stats);
+                       st.stats1.tp_packets += st.stats1.tp_drops;
                        data = &st.stats1;
                }