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
This commit is contained in:
Bruce M Simpson 2006-12-10 13:44:00 +00:00
parent ba4b9e0121
commit 3dbee59bd4

View File

@ -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