summaryrefslogtreecommitdiffstats
path: root/sys/netgraph/ng_fec.c
diff options
context:
space:
mode:
authorru <ru@FreeBSD.org>2006-09-15 16:06:27 +0000
committerru <ru@FreeBSD.org>2006-09-15 16:06:27 +0000
commit8daf5708793187a7f3158d1a5582ae00dec135ff (patch)
treeecfb2b0513fe782ebcbdd04968e9e115494f790a /sys/netgraph/ng_fec.c
parent7accf1bc7386adb6308f92e76f145e2fcca9949a (diff)
downloadFreeBSD-src-8daf5708793187a7f3158d1a5582ae00dec135ff.zip
FreeBSD-src-8daf5708793187a7f3158d1a5582ae00dec135ff.tar.gz
Make it possible to set a larger MTU by attempting to set MTUs on all
trunk ports first. If that succeeds, and we're inside our own bounds, so be it. Still not ideal -- adding a port after changing an MTU doesn't change port's MTU, but a step in the right direction. PR: kern/95417 Submitted by: Vladimir Ivanov <wawa AT yandex-team DOT ru> MFC after: 3 days I've slightly edited a patch to make the conditional logic positive and remove (what I think was) a redundant ng_fec_init() call.
Diffstat (limited to 'sys/netgraph/ng_fec.c')
-rw-r--r--sys/netgraph/ng_fec.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c
index 972a00a..e47abab 100644
--- a/sys/netgraph/ng_fec.c
+++ b/sys/netgraph/ng_fec.c
@@ -694,10 +694,28 @@ ng_fec_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
/* These two are mostly handled at a higher layer */
case SIOCSIFADDR:
case SIOCGIFADDR:
- case SIOCSIFMTU:
error = ether_ioctl(ifp, command, data);
break;
+ case SIOCSIFMTU:
+ if (ifr->ifr_mtu >= NG_FEC_MTU_MIN &&
+ ifr->ifr_mtu <= NG_FEC_MTU_MAX) {
+ struct ng_fec_portlist *p;
+ struct ifnet *bifp;
+
+ TAILQ_FOREACH(p, &b->ng_fec_ports, fec_list) {
+ bifp = p->fec_if;
+ error = (*bifp->if_ioctl)(bifp, SIOCSIFMTU,
+ data);
+ if (error != 0)
+ break;
+ }
+ if (error == 0)
+ ifp->if_mtu = ifr->ifr_mtu;
+ } else
+ error = EINVAL;
+ break;
+
/* Set flags */
case SIOCSIFFLAGS:
/*
OpenPOWER on IntegriCloud