summaryrefslogtreecommitdiffstats
path: root/sys/net/if_gre.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_gre.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_gre.c')
-rw-r--r--sys/net/if_gre.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index 48255b0..3d33766 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -113,8 +113,8 @@ static void gre_clone_destroy(struct ifnet *);
static struct if_clone *gre_cloner;
static int gre_ioctl(struct ifnet *, u_long, caddr_t);
-static int gre_output(struct ifnet *, struct mbuf *, struct sockaddr *,
- struct route *ro);
+static int gre_output(struct ifnet *, struct mbuf *,
+ const struct sockaddr *, struct route *);
static int gre_compute_route(struct gre_softc *sc);
@@ -241,7 +241,7 @@ gre_clone_destroy(ifp)
* given by sc->g_proto. See also RFC 1701 and RFC 2004
*/
static int
-gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
+gre_output(struct ifnet *ifp, struct mbuf *m, const struct sockaddr *dst,
struct route *ro)
{
int error = 0;
@@ -333,20 +333,18 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
ip = NULL;
/* 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);
- }
m->m_flags &= ~(M_BCAST|M_MCAST);
if (sc->g_proto == IPPROTO_MOBILE) {
- if (dst->sa_family == AF_INET) {
+ if (af == AF_INET) {
struct mbuf *m0;
int msiz;
@@ -417,7 +415,7 @@ gre_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
goto end;
}
} else if (sc->g_proto == IPPROTO_GRE) {
- switch (dst->sa_family) {
+ switch (af) {
case AF_INET:
ip = mtod(m, struct ip *);
gre_ip_tos = ip->ip_tos;
OpenPOWER on IntegriCloud