diff options
author | Bruce M Simpson <bms@FreeBSD.org> | 2006-12-10 13:44:00 +0000 |
---|---|---|
committer | Bruce M Simpson <bms@FreeBSD.org> | 2006-12-10 13:44:00 +0000 |
commit | 3dbee59bd40d3f26d47b0d1e9e6cb7ce251e3240 (patch) | |
tree | 1e67d0ceb4ebb96f1d93b3cb1e275fc100c3d032 | |
parent | ba4b9e0121c4175c022d7c26658ed9e8bb56048c (diff) | |
download | src-3dbee59bd40d3f26d47b0d1e9e6cb7ce251e3240.tar.gz src-3dbee59bd40d3f26d47b0d1e9e6cb7ce251e3240.zip |
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
Notes
Notes:
svn path=/head/; revision=165082
-rw-r--r-- | sys/netinet/ip_output.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 4a738a5219a6..500fefff3703 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 |