diff options
author | kmacy <kmacy@FreeBSD.org> | 2009-04-16 20:30:28 +0000 |
---|---|---|
committer | kmacy <kmacy@FreeBSD.org> | 2009-04-16 20:30:28 +0000 |
commit | 24b38efdce5f73d92ac948039ef4966d9502b484 (patch) | |
tree | f09ffe8dbc619e723cdaebdc910a5ed28f73768b /sys/netinet | |
parent | ae4f793822da0acb8cd844e26144e060eebff125 (diff) | |
download | FreeBSD-src-24b38efdce5f73d92ac948039ef4966d9502b484.zip FreeBSD-src-24b38efdce5f73d92ac948039ef4966d9502b484.tar.gz |
Change if_output to take a struct route as its fourth argument in order
to allow passing a cached struct llentry * down to L2
Reviewed by: rwatson
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/if_ether.c | 4 | ||||
-rw-r--r-- | sys/netinet/ip_carp.c | 7 | ||||
-rw-r--r-- | sys/netinet/ip_fastfwd.c | 6 | ||||
-rw-r--r-- | sys/netinet/ip_output.c | 4 |
4 files changed, 12 insertions, 9 deletions
diff --git a/sys/netinet/if_ether.c b/sys/netinet/if_ether.c index 90ef00d..38e420e 100644 --- a/sys/netinet/if_ether.c +++ b/sys/netinet/if_ether.c @@ -238,7 +238,7 @@ arprequest(struct ifnet *ifp, struct in_addr *sip, struct in_addr *tip, sa.sa_family = AF_ARP; sa.sa_len = 2; m->m_flags |= M_BCAST; - (*ifp->if_output)(ifp, m, &sa, (struct rtentry *)0); + (*ifp->if_output)(ifp, m, &sa, NULL); } /* @@ -753,7 +753,7 @@ reply: m->m_pkthdr.len = m->m_len; sa.sa_family = AF_ARP; sa.sa_len = 2; - (*ifp->if_output)(ifp, m, &sa, (struct rtentry *)0); + (*ifp->if_output)(ifp, m, &sa, NULL); return; drop: diff --git a/sys/netinet/ip_carp.c b/sys/netinet/ip_carp.c index cc74580..33b5059 100644 --- a/sys/netinet/ip_carp.c +++ b/sys/netinet/ip_carp.c @@ -207,7 +207,7 @@ static void carp_master_down(void *); static void carp_master_down_locked(struct carp_softc *); static int carp_ioctl(struct ifnet *, u_long, caddr_t); static int carp_looutput(struct ifnet *, struct mbuf *, struct sockaddr *, - struct rtentry *); + struct route *); static void carp_start(struct ifnet *); static void carp_setrun(struct carp_softc *, sa_family_t); static void carp_set_state(struct carp_softc *, int); @@ -2011,12 +2011,15 @@ carp_ioctl(struct ifnet *ifp, u_long cmd, caddr_t addr) */ static int carp_looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, - struct rtentry *rt) + struct route *ro) { u_int32_t af; + struct rtentry *rt = NULL; M_ASSERTPKTHDR(m); /* check if we have the packet header */ + if (ro != NULL) + rt = ro->ro_rt; if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) { m_freem(m); return (rt->rt_flags & RTF_BLACKHOLE ? 0 : diff --git a/sys/netinet/ip_fastfwd.c b/sys/netinet/ip_fastfwd.c index 0479064..8752916 100644 --- a/sys/netinet/ip_fastfwd.c +++ b/sys/netinet/ip_fastfwd.c @@ -183,7 +183,7 @@ ip_fastforward(struct mbuf *m) M_ASSERTVALID(m); M_ASSERTPKTHDR(m); - ro.ro_rt = NULL; + bzero(&ro, sizeof(ro)); /* * Step 1: check for packet drop conditions (and sanity checks) @@ -552,7 +552,7 @@ passout: * Send off the packet via outgoing interface */ error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro.ro_rt); + (struct sockaddr *)dst, &ro); } else { /* * Handle EMSGSIZE with icmp reply needfrag for TCP MTU discovery @@ -585,7 +585,7 @@ passout: m->m_nextpkt = NULL; error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro.ro_rt); + (struct sockaddr *)dst, &ro); if (error) break; } while ((m = m0) != NULL); diff --git a/sys/netinet/ip_output.c b/sys/netinet/ip_output.c index 16dba61..76d8f2a 100644 --- a/sys/netinet/ip_output.c +++ b/sys/netinet/ip_output.c @@ -595,7 +595,7 @@ passout: */ m->m_flags &= ~(M_PROTOFLAGS); error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro->ro_rt); + (struct sockaddr *)dst, ro); goto done; } @@ -629,7 +629,7 @@ passout: m->m_flags &= ~(M_PROTOFLAGS); error = (*ifp->if_output)(ifp, m, - (struct sockaddr *)dst, ro->ro_rt); + (struct sockaddr *)dst, ro); } else m_freem(m); } |