Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Consider the configured MTU of the interface when de...
details: https://anonhg.NetBSD.org/src/rev/626539187756
branches: trunk
changeset: 510637:626539187756
user: thorpej <thorpej%NetBSD.org@localhost>
date: Sun Jun 03 03:24:23 2001 +0000
description:
Consider the configured MTU of the interface when determining
if a packet is too large.
diffstat:
sys/net/if_ether.h | 6 +++---
sys/net/if_ethersubr.c | 5 +++--
2 files changed, 6 insertions(+), 5 deletions(-)
diffs (39 lines):
diff -r d231a57f04b6 -r 626539187756 sys/net/if_ether.h
--- a/sys/net/if_ether.h Sun Jun 03 03:12:31 2001 +0000
+++ b/sys/net/if_ether.h Sun Jun 03 03:24:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ether.h,v 1.24 2001/06/03 03:07:40 thorpej Exp $ */
+/* $NetBSD: if_ether.h,v 1.25 2001/06/03 03:24:23 thorpej Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@@ -83,8 +83,8 @@
* Compute the maximum frame size based on ethertype (i.e. possible
* encapsulation) and whether or not an FCS is present.
*/
-#define ETHER_MAX_FRAME(etype, hasfcs) \
- (ETHERMTU + ETHER_HDR_LEN + \
+#define ETHER_MAX_FRAME(ifp, etype, hasfcs) \
+ ((ifp)->if_mtu + ETHER_HDR_LEN + \
((hasfcs) ? ETHER_CRC_LEN : 0) + \
(((etype) == ETHERTYPE_VLAN) ? ETHER_VLAN_ENCAP_LEN : 0))
diff -r d231a57f04b6 -r 626539187756 sys/net/if_ethersubr.c
--- a/sys/net/if_ethersubr.c Sun Jun 03 03:12:31 2001 +0000
+++ b/sys/net/if_ethersubr.c Sun Jun 03 03:24:23 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_ethersubr.c,v 1.82 2001/06/03 03:07:39 thorpej Exp $ */
+/* $NetBSD: if_ethersubr.c,v 1.83 2001/06/03 03:24:23 thorpej Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -653,7 +653,8 @@
/*
* Determine if the packet is within its size limits.
*/
- if (m->m_pkthdr.len > ETHER_MAX_FRAME(etype, m->m_flags & M_HASFCS)) {
+ if (m->m_pkthdr.len >
+ ETHER_MAX_FRAME(ifp, etype, m->m_flags & M_HASFCS)) {
printf("%s: discarding oversize frame (len=%d)\n",
ifp->if_xname, m->m_pkthdr.len);
m_freem(m);
Home |
Main Index |
Thread Index |
Old Index