From 1589529acaf2124884be358149d74a86663decdb Mon Sep 17 00:00:00 2001 From: bms Date: Sun, 10 Dec 2006 13:44:00 +0000 Subject: Back out revision 1.264. Fixing the IP accounting issue, if we plan to do so, needs to be better thought out; the 'fix' introduces a hash lookup and a possible kernel panic. Reported by: Mark Tinguely --- sys/netinet/ip_output.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'sys/netinet/ip_output.c') diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 4a738a5..500feff 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -118,7 +118,6 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int len, error = 0; struct sockaddr_in *dst = NULL; /* keep compiler happy */ struct in_ifaddr *ia = NULL; - struct in_ifaddr *sia = NULL; int isbroadcast, sw_csum; struct route iproute; struct in_addr odst; @@ -535,15 +534,12 @@ passout: * once instead of for every generated packet. */ if (!(flags & IP_FORWARDING) && ia) { - INADDR_TO_IFADDR(ip->ip_src, sia); - if (sia == NULL) - sia = ia; if (m->m_pkthdr.csum_flags & CSUM_TSO) - sia->ia_ifa.if_opackets += + ia->ia_ifa.if_opackets += m->m_pkthdr.len / m->m_pkthdr.tso_segsz; else - sia->ia_ifa.if_opackets++; - sia->ia_ifa.if_obytes += m->m_pkthdr.len; + ia->ia_ifa.if_opackets++; + ia->ia_ifa.if_obytes += m->m_pkthdr.len; } #ifdef IPSEC /* clean ipsec history once it goes out of the node */ @@ -588,11 +584,8 @@ passout: if (error == 0) { /* Record statistics for this interface address. */ if (ia != NULL) { - INADDR_TO_IFADDR(ip->ip_src, sia); - if (sia == NULL) - sia = ia; - sia->ia_ifa.if_opackets++; - sia->ia_ifa.if_obytes += m->m_pkthdr.len; + ia->ia_ifa.if_opackets++; + ia->ia_ifa.if_obytes += m->m_pkthdr.len; } /* * Reset layer specific mbuf flags -- cgit v1.1