diff options
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r-- | sys/net/if_loop.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index acf8012..499cd2c 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -101,7 +101,7 @@ int loioctl(struct ifnet *, u_long, caddr_t); static void lortrequest(int, struct rtentry *, struct rt_addrinfo *); int looutput(struct ifnet *ifp, struct mbuf *m, - struct sockaddr *dst, struct route *ro); + const struct sockaddr *dst, struct route *ro); static int lo_clone_create(struct if_clone *, int, caddr_t); static void lo_clone_destroy(struct ifnet *); @@ -210,7 +210,7 @@ static moduledata_t loop_mod = { DECLARE_MODULE(if_lo, loop_mod, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY); int -looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, +looutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst, struct route *ro) { u_int32_t af; @@ -241,13 +241,13 @@ looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, ifp->if_obytes += m->m_pkthdr.len; /* BPF writes need to be handled specially. */ - if (dst->sa_family == AF_UNSPEC) { + if (dst->sa_family == AF_UNSPEC) bcopy(dst->sa_data, &af, sizeof(af)); - dst->sa_family = af; - } + else + af = dst->sa_family; #if 1 /* XXX */ - switch (dst->sa_family) { + switch (af) { case AF_INET: if (ifp->if_capenable & IFCAP_RXCSUM) { m->m_pkthdr.csum_data = 0xffff; @@ -276,12 +276,12 @@ looutput(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst, case AF_APPLETALK: break; default: - printf("looutput: af=%d unexpected\n", dst->sa_family); + printf("looutput: af=%d unexpected\n", af); m_freem(m); return (EAFNOSUPPORT); } #endif - return (if_simloop(ifp, m, dst->sa_family, 0)); + return (if_simloop(ifp, m, af, 0)); } /* |