diff options
Diffstat (limited to 'sys/netinet/ip_output.c')
-rw-r--r-- | sys/netinet/ip_output.c | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 231510a..946626a 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -50,6 +50,7 @@ __FBSDID("$FreeBSD$"); #include <sys/socketvar.h> #include <sys/sysctl.h> #include <sys/ucred.h> +#include <sys/vimage.h> #include <net/if.h> #include <net/netisr.h> @@ -155,7 +156,7 @@ ip_output(struct mbuf *m, struct mbuf *opt, struct route *ro, int flags, ip->ip_v = IPVERSION; ip->ip_hl = hlen >> 2; ip->ip_id = ip_newid(); - ipstat.ips_localout++; + V_ipstat.ips_localout++; } else { hlen = ip->ip_hl << 2; } @@ -194,7 +195,7 @@ again: if (flags & IP_SENDONES) { if ((ia = ifatoia(ifa_ifwithbroadaddr(sintosa(dst)))) == NULL && (ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL) { - ipstat.ips_noroute++; + V_ipstat.ips_noroute++; error = ENETUNREACH; goto bad; } @@ -206,7 +207,7 @@ again: } else if (flags & IP_ROUTETOIF) { if ((ia = ifatoia(ifa_ifwithdstaddr(sintosa(dst)))) == NULL && (ia = ifatoia(ifa_ifwithnet(sintosa(dst)))) == NULL) { - ipstat.ips_noroute++; + V_ipstat.ips_noroute++; error = ENETUNREACH; goto bad; } @@ -238,7 +239,7 @@ again: inp ? inp->inp_inc.inc_fibnum : M_GETFIB(m)); #endif if (ro->ro_rt == NULL) { - ipstat.ips_noroute++; + V_ipstat.ips_noroute++; error = EHOSTUNREACH; goto bad; } @@ -297,7 +298,7 @@ again: */ if ((imo == NULL) || (imo->imo_multicast_vif == -1)) { if ((ifp->if_flags & IFF_MULTICAST) == 0) { - ipstat.ips_noroute++; + V_ipstat.ips_noroute++; error = ENETUNREACH; goto bad; } @@ -338,14 +339,14 @@ again: * above, will be forwarded by the ip_input() routine, * if necessary. */ - if (ip_mrouter && (flags & IP_FORWARDING) == 0) { + if (V_ip_mrouter && (flags & IP_FORWARDING) == 0) { /* * If rsvp daemon is not running, do not * set ip_moptions. This ensures that the packet * is multicast and not just sent down one link * as prescribed by rsvpd. */ - if (!rsvp_on) + if (!V_rsvp_on) imo = NULL; if (ip_mforward && ip_mforward(ip, ifp, m, imo) != 0) { @@ -397,7 +398,7 @@ again: #endif /* ALTQ */ { error = ENOBUFS; - ipstat.ips_odropped++; + V_ipstat.ips_odropped++; ifp->if_snd.ifq_drops += (ip->ip_len / ifp->if_mtu + 1); goto bad; } @@ -461,7 +462,7 @@ sendit: if (in_localip(ip->ip_dst)) { m->m_flags |= M_FASTFWD_OURS; if (m->m_pkthdr.rcvif == NULL) - m->m_pkthdr.rcvif = loif; + m->m_pkthdr.rcvif = V_loif; if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; @@ -480,7 +481,7 @@ sendit: /* See if local, if yes, send it to netisr with IP_FASTFWD_OURS. */ if (m->m_flags & M_FASTFWD_OURS) { if (m->m_pkthdr.rcvif == NULL) - m->m_pkthdr.rcvif = loif; + m->m_pkthdr.rcvif = V_loif; if (m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) { m->m_pkthdr.csum_flags |= CSUM_DATA_VALID | CSUM_PSEUDO_HDR; @@ -508,7 +509,7 @@ passout: if ((ntohl(ip->ip_dst.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET || (ntohl(ip->ip_src.s_addr) >> IN_CLASSA_NSHIFT) == IN_LOOPBACKNET) { if ((ifp->if_flags & IFF_LOOPBACK) == 0) { - ipstat.ips_badaddr++; + V_ipstat.ips_badaddr++; error = EADDRNOTAVAIL; goto bad; } @@ -567,7 +568,7 @@ passout: /* Balk when DF bit is set or the interface didn't support TSO. */ if ((ip->ip_off & IP_DF) || (m->m_pkthdr.csum_flags & CSUM_TSO)) { error = EMSGSIZE; - ipstat.ips_cantfrag++; + V_ipstat.ips_cantfrag++; goto bad; } @@ -600,7 +601,7 @@ passout: } if (error == 0) - ipstat.ips_fragmented++; + V_ipstat.ips_fragmented++; done: if (ro == &iproute && ro->ro_rt) { @@ -635,7 +636,7 @@ ip_fragment(struct ip *ip, struct mbuf **m_frag, int mtu, int nfrags; if (ip->ip_off & IP_DF) { /* Fragmentation not allowed */ - ipstat.ips_cantfrag++; + V_ipstat.ips_cantfrag++; return EMSGSIZE; } @@ -710,7 +711,7 @@ smart_frag_failure: MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) { error = ENOBUFS; - ipstat.ips_odropped++; + V_ipstat.ips_odropped++; goto done; } m->m_flags |= (m0->m_flags & M_MCAST) | M_FRAG; @@ -740,7 +741,7 @@ smart_frag_failure: if (m->m_next == NULL) { /* copy failed */ m_free(m); error = ENOBUFS; /* ??? */ - ipstat.ips_odropped++; + V_ipstat.ips_odropped++; goto done; } m->m_pkthdr.len = mhlen + len; @@ -756,7 +757,7 @@ smart_frag_failure: *mnext = m; mnext = &m->m_nextpkt; } - ipstat.ips_ofragments += nfrags; + V_ipstat.ips_ofragments += nfrags; /* set first marker for fragment chain */ m0->m_flags |= M_FIRSTFRAG | M_FRAG; |