diff options
author | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2008-05-07 07:16:50 +0000 |
---|---|---|
committer | Pierre-Yves Ritschard <pyr@cvs.openbsd.org> | 2008-05-07 07:16:50 +0000 |
commit | 4e255224e7d72d76566db678565a58232ef4a98e (patch) | |
tree | b957a51bd12bfceb051fa6291f74202139302706 /sys | |
parent | de00169788d17d1afbb465a8138926ecfd201cac (diff) |
Make mpe a point-to-point interface.
Make the mtu user definable.
ok claudio@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if_mpe.c | 10 | ||||
-rw-r--r-- | sys/netmpls/mpls.h | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/sys/net/if_mpe.c b/sys/net/if_mpe.c index aee5e894bbb..28c05d5621f 100644 --- a/sys/net/if_mpe.c +++ b/sys/net/if_mpe.c @@ -68,8 +68,9 @@ mpe_clone_create(struct if_clone *ifc, int unit) mpeif->sc_unit = unit; ifp = &mpeif->sc_if; snprintf(ifp->if_xname, sizeof ifp->if_xname, "mpe%d", unit); + ifp->if_flags = IFF_POINTOPOINT; ifp->if_softc = mpeif; - ifp->if_mtu = 1500; + ifp->if_mtu = MPE_MTU; ifp->if_ioctl = mpeioctl; ifp->if_output = mpeoutput; ifp->if_start = mpestart; @@ -183,6 +184,13 @@ mpeioctl(struct ifnet *ifp, u_long cmd, caddr_t data) else ifp->if_flags &= ~IFF_RUNNING; break; + case SIOCSIFMTU: + if (ifr->ifr_mtu < MPE_MTU_MIN || + ifr->ifr_mtu > MPE_MTU_MAX) + error = EINVAL; + else + ifp->if_mtu = ifr->ifr_mtu; + break; case SIOCGETLABEL: ifm = ifp->if_softc; shim.shim_label = diff --git a/sys/netmpls/mpls.h b/sys/netmpls/mpls.h index 0025cd6d462..e65ecd470e0 100644 --- a/sys/netmpls/mpls.h +++ b/sys/netmpls/mpls.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mpls.h,v 1.6 2008/05/07 06:53:42 pyr Exp $ */ +/* $OpenBSD: mpls.h,v 1.7 2008/05/07 07:16:49 pyr Exp $ */ /* * Copyright (C) 1999, 2000 and 2001 AYAME Project, WIDE Project. @@ -148,6 +148,9 @@ struct mpe_softc { }; #define MPE_HDRLEN sizeof(struct shim_hdr) +#define MPE_MTU 1500 +#define MPE_MTU_MIN 256 +#define MPE_MTU_MAX 8192 extern int mpls_raw_usrreq(struct socket *, int, struct mbuf *, struct mbuf *, struct mbuf *); |