Quoting David Miller: | | > Fix: Move the `UDP_INC_STATS_BH(UDP_MIB_INDATAGRAMS)' statement from | > udp_queue_rcv_skb to udp_recvmsg. Now InDatagrams only counts those | > datagrams which were really delivered (as per RFC 2013). | > | | Unfortunately this breaks NFS and other in-kernel UDP socket usages, | which never call recvmsg() and instead take the packet via the | ->data_ready() callback done by sock_queue_receive_skb(). | | Your patch will make the counter never get incremented when such | a user is using the UDP socket. | | Probably a better way to handle this is to correct the | INDATAGRAMS value by decrementing it when we notice that | the checksum is incorrect in a deferred manner. This is clearly preferable - would it look like this:
csum_copy_err: UDP_INC_STATS_BH(UDP_MIB_INERRORS); UDP_DEC_STATS_BH(UDP_MIB_INDATAGRAMS); /* requires new macro */ skb_kill_datagram(sk, skb, flags); /* ... */ in udp_recvmsg? Here I must pass - there is no xxx_DEC_BH macro in include/net/snmp.h and I don't know whether the following guess is correct: #define SNMP_DEC_STATS_BH(mib, field) \ (per_cpu_ptr(mib[0], raw_smp_processor_id())->mibs[field]--) If this is correct, then it seems done; one could use this macro or add a corresponding UDP_DEC_STATS_BH to include/net/udp.h . - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html