summaryrefslogtreecommitdiffstats
path: root/sys/net/if_loop.c
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2013-04-26 12:50:32 +0000
committerglebius <glebius@FreeBSD.org>2013-04-26 12:50:32 +0000
commitb4bc270e8f6757fa385861750ab22ba0ca4978ed (patch)
tree073e97431b8851637e702226bc02446cb01b0f4b /sys/net/if_loop.c
parent7eab2144525c38723764e418181b36c7e9cbafad (diff)
downloadFreeBSD-src-b4bc270e8f6757fa385861750ab22ba0ca4978ed.zip
FreeBSD-src-b4bc270e8f6757fa385861750ab22ba0ca4978ed.tar.gz
Add const qualifier to the dst parameter of the ifnet if_output method.
Diffstat (limited to 'sys/net/if_loop.c')
-rw-r--r--sys/net/if_loop.c16
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));
}
/*
OpenPOWER on IntegriCloud