diff options
-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 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 |