summaryrefslogtreecommitdiffstats
path: root/sys/net/if_faith.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_faith.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_faith.c')
-rw-r--r--sys/net/if_faith.c23
1 files changed, 9 insertions, 14 deletions
diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c
index 907dcce..37a53bb 100644
--- a/sys/net/if_faith.c
+++ b/sys/net/if_faith.c
@@ -84,7 +84,7 @@ struct faith_softc {
};
static int faithioctl(struct ifnet *, u_long, caddr_t);
-int faithoutput(struct ifnet *, struct mbuf *, struct sockaddr *,
+static int faithoutput(struct ifnet *, struct mbuf *, const struct sockaddr *,
struct route *);
static void faithrtrequest(int, struct rtentry *, struct rt_addrinfo *);
#ifdef INET6
@@ -184,12 +184,9 @@ faith_clone_destroy(ifp)
free(sc, M_FAITH);
}
-int
-faithoutput(ifp, m, dst, ro)
- struct ifnet *ifp;
- struct mbuf *m;
- struct sockaddr *dst;
- struct route *ro;
+static int
+faithoutput(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
+ struct route *ro)
{
int isr;
u_int32_t af;
@@ -200,15 +197,13 @@ faithoutput(ifp, m, dst, ro)
if (ro != NULL)
rt = ro->ro_rt;
/* 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;
- }
-
- if (bpf_peers_present(ifp->if_bpf)) {
+ else
af = dst->sa_family;
+
+ if (bpf_peers_present(ifp->if_bpf))
bpf_mtap2(ifp->if_bpf, &af, sizeof(af), m);
- }
if (rt && rt->rt_flags & (RTF_REJECT|RTF_BLACKHOLE)) {
m_freem(m);
@@ -217,7 +212,7 @@ faithoutput(ifp, m, dst, ro)
}
ifp->if_opackets++;
ifp->if_obytes += m->m_pkthdr.len;
- switch (dst->sa_family) {
+ switch (af) {
#ifdef INET
case AF_INET:
isr = NETISR_IP;
OpenPOWER on IntegriCloud