diff options
author | Kristof Provost <kp@FreeBSD.org> | 2021-07-26 10:18:27 +0000 |
---|---|---|
committer | Kristof Provost <kp@FreeBSD.org> | 2021-07-28 20:03:30 +0000 |
commit | 01ad0c0079646a31afa20e1f07e5b62b82613493 (patch) | |
tree | 9f92fa53972214163a3504fe5b4136206482b35d /sys/net | |
parent | 6e439506408d36a663e666d35a340595539270a4 (diff) | |
download | src-01ad0c0079646a31afa20e1f07e5b62b82613493.tar.gz src-01ad0c0079646a31afa20e1f07e5b62b82613493.zip |
net: disallow MTU changes on bridge member interfaces
if_bridge member interfaces should always have the same MTU as the
bridge itself, so disallow MTU changes on interfaces that are part of an
if_bridge.
Reviewed by: donner
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D31304
Diffstat (limited to 'sys/net')
-rw-r--r-- | sys/net/if.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index cfa795904bc9..8d2a66471836 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -2746,6 +2746,9 @@ ifhwioctl(u_long cmd, struct ifnet *ifp, caddr_t data, struct thread *td) return (EINVAL); if (ifp->if_ioctl == NULL) return (EOPNOTSUPP); + /* Disallow MTU changes on bridge member interfaces. */ + if (ifp->if_bridge) + return (EOPNOTSUPP); error = (*ifp->if_ioctl)(ifp, cmd, data); if (error == 0) { getmicrotime(&ifp->if_lastchange); |