diff options
author | Stuart Henderson <sthen@cvs.openbsd.org> | 2012-11-23 20:12:04 +0000 |
---|---|---|
committer | Stuart Henderson <sthen@cvs.openbsd.org> | 2012-11-23 20:12:04 +0000 |
commit | 673d5d2ec6990bc4e901b79ee906e6d0f48e65b9 (patch) | |
tree | 5fb69070cb9b4839ceee9516f7821a8180ac4759 /sys/net | |
parent | 937ba45cfaba46497bf3a2e8f8bbe0c23f07c8ba (diff) |
Add SIOCGIFHARDMTU to allow retrieving the driver's maximum supported MTU
looks fine reyk@ ok mikeb@
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.c | 6 | ||||
-rw-r--r-- | sys/net/if.h | 3 | ||||
-rw-r--r-- | sys/net/if_gre.c | 5 | ||||
-rw-r--r-- | sys/net/if_spppsubr.c | 7 |
4 files changed, 17 insertions, 4 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index b6ccd30202f..b0a3cb87c13 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.247 2012/10/23 17:41:00 claudio Exp $ */ +/* $OpenBSD: if.c,v 1.248 2012/11/23 20:12:03 sthen Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -1268,6 +1268,10 @@ ifioctl(struct socket *so, u_long cmd, caddr_t data, struct proc *p) ifr->ifr_mtu = ifp->if_mtu; break; + case SIOCGIFHARDMTU: + ifr->ifr_hardmtu = ifp->if_hardmtu; + break; + case SIOCGIFDATA: error = copyout((caddr_t)&ifp->if_data, ifr->ifr_data, sizeof(ifp->if_data)); diff --git a/sys/net/if.h b/sys/net/if.h index e00ffa3dc98..0cf96f90ece 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.136 2012/11/11 04:45:37 deraadt Exp $ */ +/* $OpenBSD: if.h,v 1.137 2012/11/23 20:12:03 sthen Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -639,6 +639,7 @@ struct ifreq { #define ifr_flags ifr_ifru.ifru_flags /* flags */ #define ifr_metric ifr_ifru.ifru_metric /* metric */ #define ifr_mtu ifr_ifru.ifru_metric /* mtu (overload) */ +#define ifr_hardmtu ifr_ifru.ifru_metric /* hardmtu (overload) */ #define ifr_media ifr_ifru.ifru_metric /* media options (overload) */ #define ifr_rdomainid ifr_ifru.ifru_metric /* VRF instance (overload) */ #define ifr_data ifr_ifru.ifru_data /* for use by interface */ diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c index 88f3ba3bd3c..7a9eeee4a49 100644 --- a/sys/net/if_gre.c +++ b/sys/net/if_gre.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_gre.c,v 1.58 2012/04/14 09:39:47 yasuoka Exp $ */ +/* $OpenBSD: if_gre.c,v 1.59 2012/11/23 20:12:03 sthen Exp $ */ /* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */ /* @@ -475,6 +475,9 @@ gre_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data) case SIOCGIFMTU: ifr->ifr_mtu = sc->sc_if.if_mtu; break; + case SIOCGIFHARDMTU: + ifr->ifr_hardmtu = sc->sc_if.if_hardmtu; + break; case SIOCADDMULTI: case SIOCDELMULTI: if (ifr == 0) { diff --git a/sys/net/if_spppsubr.c b/sys/net/if_spppsubr.c index 8e505949ad5..91a365262c4 100644 --- a/sys/net/if_spppsubr.c +++ b/sys/net/if_spppsubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_spppsubr.c,v 1.98 2012/07/24 15:16:20 deraadt Exp $ */ +/* $OpenBSD: if_spppsubr.c,v 1.99 2012/11/23 20:12:03 sthen Exp $ */ /* * Synchronous PPP/Cisco link level subroutines. * Keepalive protocol implemented in both Cisco and PPP modes. @@ -1117,6 +1117,11 @@ sppp_ioctl(struct ifnet *ifp, u_long cmd, void *data) ifr->ifr_mtu = ifp->if_mtu; break; #endif +#ifdef SIOCGIFHARDMTU + case SIOCGIFHARDMTU: + ifr->ifr_hardmtu = ifp->if_hardmtu; + break; +#endif #ifdef SLIOCGETMTU case SLIOCGETMTU: *(short*)data = ifp->if_mtu; |