summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_output.c
diff options
context:
space:
mode:
authorbms <bms@FreeBSD.org>2006-12-10 13:44:00 +0000
committerbms <bms@FreeBSD.org>2006-12-10 13:44:00 +0000
commit1589529acaf2124884be358149d74a86663decdb (patch)
tree1e67d0ceb4ebb96f1d93b3cb1e275fc100c3d032 /sys/netinet/ip_output.c
parent291ec8d867d1ecbb7adb1ce9182c21122d558702 (diff)
downloadFreeBSD-src-1589529acaf2124884be358149d74a86663decdb.zip
FreeBSD-src-1589529acaf2124884be358149d74a86663decdb.tar.gz
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
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r--sys/netinet/ip_output.c17
1 files changed, 5 insertions, 12 deletions
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
OpenPOWER on IntegriCloud