summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_iface.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/netgraph/ng_iface.c')
-rw-r--r--sys/netgraph/ng_iface.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/netgraph/ng_iface.c b/sys/netgraph/ng_iface.c
index 5e6f12f..e6ac508 100644
--- a/sys/netgraph/ng_iface.c
+++ b/sys/netgraph/ng_iface.c
@@ -123,7 +123,7 @@ typedef struct ng_iface_private *priv_p;
static void ng_iface_start(struct ifnet *ifp);
static int ng_iface_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
static int ng_iface_output(struct ifnet *ifp, struct mbuf *m0,
- struct sockaddr *dst, struct route *ro);
+ const struct sockaddr *dst, struct route *ro);
static void ng_iface_bpftap(struct ifnet *ifp,
struct mbuf *m, sa_family_t family);
static int ng_iface_send(struct ifnet *ifp, struct mbuf *m,
@@ -353,7 +353,7 @@ ng_iface_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
static int
ng_iface_output(struct ifnet *ifp, struct mbuf *m,
- struct sockaddr *dst, struct route *ro)
+ const struct sockaddr *dst, struct route *ro)
{
struct m_tag *mtag;
uint32_t af;
@@ -385,13 +385,13 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m,
m_tag_prepend(m, mtag);
/* 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;
/* Berkeley packet filter */
- ng_iface_bpftap(ifp, m, dst->sa_family);
+ ng_iface_bpftap(ifp, m, af);
if (ALTQ_IS_ENABLED(&ifp->if_snd)) {
M_PREPEND(m, sizeof(sa_family_t), M_NOWAIT);
@@ -402,10 +402,10 @@ ng_iface_output(struct ifnet *ifp, struct mbuf *m,
ifp->if_oerrors++;
return (ENOBUFS);
}
- *(sa_family_t *)m->m_data = dst->sa_family;
+ *(sa_family_t *)m->m_data = af;
error = (ifp->if_transmit)(ifp, m);
} else
- error = ng_iface_send(ifp, m, dst->sa_family);
+ error = ng_iface_send(ifp, m, af);
return (error);
}
OpenPOWER on IntegriCloud