-/* $OpenBSD: if.c,v 1.28 2000/03/12 03:54:43 itojun Exp $ */
+/* $OpenBSD: if.c,v 1.29 2000/03/21 23:31:26 mickey Exp $ */
/* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */
/*
ifr->ifr_metric = ifp->if_metric;
break;
+ case SIOCGIFMTU:
+ ifr->ifr_mtu = ifp->if_mtu;
+ break;
+
case SIOCGIFDATA:
error = copyout((caddr_t)&ifp->if_data, ifr->ifr_data,
sizeof(ifp->if_data));
ifp->if_metric = ifr->ifr_metric;
break;
+ case SIOCSIFMTU:
+ {
+#ifdef INET6
+ int oldmtu = ifp->if_mtu;
+#endif
+
+ if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
+ return (error);
+ if (ifp->if_ioctl == NULL)
+ return (EOPNOTSUPP);
+ error = (*ifp->if_ioctl)(ifp, cmd, data);
+
+ /*
+ * If the link MTU changed, do network layer specific procedure.
+ */
+#ifdef INET6
+ if (ifp->if_mtu != oldmtu)
+ nd6_setmtu(ifp);
+#endif
+ break;
+ }
+
case SIOCADDMULTI:
case SIOCDELMULTI:
case SIOCSIFMEDIA:
-/* $OpenBSD: if.h,v 1.15 2000/02/02 17:14:36 itojun Exp $ */
+/* $OpenBSD: if.h,v 1.16 2000/03/21 23:31:26 mickey Exp $ */
/* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */
/*
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast address */
#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_media ifr_ifru.ifru_metric /* media options (overload) */
#define ifr_data ifr_ifru.ifru_data /* for use by interface */
};
-/* $OpenBSD: if_ppp.c,v 1.15 1999/12/08 06:50:18 itojun Exp $ */
+/* $OpenBSD: if_ppp.c,v 1.16 2000/03/21 23:31:27 mickey Exp $ */
/* $NetBSD: if_ppp.c,v 1.39 1997/05/17 21:11:59 christos Exp $ */
/*
u_long cmd;
caddr_t data;
{
- register struct proc *p = curproc; /* XXX */
register struct ppp_softc *sc = ifp->if_softc;
register struct ifaddr *ifa = (struct ifaddr *)data;
register struct ifreq *ifr = (struct ifreq *)data;
break;
case SIOCSIFMTU:
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
- break;
sc->sc_if.if_mtu = ifr->ifr_mtu;
break;
- case SIOCGIFMTU:
- ifr->ifr_mtu = sc->sc_if.if_mtu;
- break;
-
case SIOCADDMULTI:
case SIOCDELMULTI:
if (ifr == 0) {
-/* $OpenBSD: if_ppp.h,v 1.4 1997/09/05 04:26:59 millert Exp $ */
+/* $OpenBSD: if_ppp.h,v 1.5 2000/03/21 23:31:27 mickey Exp $ */
/* $NetBSD: if_ppp.h,v 1.11 1996/03/15 02:28:05 paulus Exp $ */
/*
#define SIOCGPPPSTATS _IOWR('i', 123, struct ifpppstatsreq)
#define SIOCGPPPCSTATS _IOWR('i', 122, struct ifpppcstatsreq)
-#if !defined(ifr_mtu)
-#define ifr_mtu ifr_ifru.ifru_metric
-#endif
-
#ifdef _KERNEL
void pppattach __P((void));
int pppoutput __P((struct ifnet *, struct mbuf *, struct sockaddr *,
-/* $OpenBSD: if_tun.c,v 1.28 1999/12/08 06:50:18 itojun Exp $ */
+/* $OpenBSD: if_tun.c,v 1.29 2000/03/21 23:31:27 mickey Exp $ */
/* $NetBSD: if_tun.c,v 1.24 1996/05/07 02:40:48 thorpej Exp $ */
/*
tuninit((struct tun_softc *)(ifp->if_softc));
TUNDEBUG(("%s: broadcast address set\n", ifp->if_xname));
break;
-#if 0
case SIOCSIFMTU:
- if ((error = suser(p->p_ucred, &p->p_acflag)) != 0)
- break;
- ((struct tun_softc *)(ifp->if_softc))->tun_if.if_mtu
- = ((struct ifreq *)data)->ifr_mtu;
- break;
- case SIOCGIFMTU:
- ((struct ifreq *)data)->ifr_mtu =
- ((struct tun_softc *)(ifp->if_softc))->tun_if.if_mtu;
+ ifp->if_mtu = ((struct ifreq *)data)->ifr_mtu;
break;
-#endif
case SIOCSIFFLAGS:
break;
default: