diff options
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 0356ec7..ea2aa85 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -74,6 +74,7 @@ #include <net/vnet.h> #if defined(INET) || defined(INET6) +#include <net/ethernet.h> #include <netinet/in.h> #include <netinet/in_var.h> #include <netinet/ip.h> @@ -658,7 +659,8 @@ if_attach_internal(struct ifnet *ifp, int vmove) #if defined(INET) || defined(INET6) /* Initialize to max value. */ if (ifp->if_hw_tsomax == 0) - ifp->if_hw_tsomax = IP_MAXPACKET; + ifp->if_hw_tsomax = min(IP_MAXPACKET, 32 * MCLBYTES - + (ETHER_HDR_LEN + ETHER_VLAN_ENCAP_LEN)); KASSERT(ifp->if_hw_tsomax <= IP_MAXPACKET && ifp->if_hw_tsomax >= IP_MAXPACKET / 8, ("%s: tsomax outside of range", __func__)); |