From 7f01dc25c42c02e2c282c71aa1237187c9606a68 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Fri, 15 Sep 2006 16:06:27 +0000 Subject: [PATCH] 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 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. --- sys/netgraph/ng_fec.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/sys/netgraph/ng_fec.c b/sys/netgraph/ng_fec.c index 972a00aa45e..e47abab898e 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: /*