Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net Correct frame padding length
details: https://anonhg.NetBSD.org/src/rev/a8a1a2f4c59b
branches: trunk
changeset: 336987:a8a1a2f4c59b
user: ozaki-r <ozaki-r%NetBSD.org@localhost>
date: Sun Mar 29 13:30:43 2015 +0000
description:
Correct frame padding length
vlan pads a frame with zeros up to 68 bytes
(ETHER_MIN_LEN + ETHER_VLAN_ENCAP_LEN). It expects
that even if the frame is untagged, it keeps 64 bytes
at least. However, it lacks concern about CRC
(4 bytes). So a sending frame can be 72 (68 + 4) bytes.
PR 49788
diffstat:
sys/net/if_vlan.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (31 lines):
diff -r 4bcbf654764f -r a8a1a2f4c59b sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Sun Mar 29 12:00:02 2015 +0000
+++ b/sys/net/if_vlan.c Sun Mar 29 13:30:43 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vlan.c,v 1.79 2015/01/16 10:36:14 ozaki-r Exp $ */
+/* $NetBSD: if_vlan.c,v 1.80 2015/03/29 13:30:43 ozaki-r Exp $ */
/*-
* Copyright (c) 2000, 2001 The NetBSD Foundation, Inc.
@@ -78,7 +78,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.79 2015/01/16 10:36:14 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.80 2015/03/29 13:30:43 ozaki-r Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -806,9 +806,10 @@
* after deleting a tag.
*/
if (m->m_pkthdr.len <
- (ETHER_MIN_LEN + ETHER_VLAN_ENCAP_LEN)) {
+ (ETHER_MIN_LEN - ETHER_CRC_LEN +
+ ETHER_VLAN_ENCAP_LEN)) {
m_copyback(m, m->m_pkthdr.len,
- (ETHER_MIN_LEN +
+ (ETHER_MIN_LEN - ETHER_CRC_LEN +
ETHER_VLAN_ENCAP_LEN) -
m->m_pkthdr.len,
vlan_zero_pad_buff);
Home |
Main Index |
Thread Index |
Old Index