Module Name: src
Committed By: martin
Date: Sat Apr 4 14:56:48 UTC 2015
Modified Files:
src/sys/net [netbsd-7]: if_vlan.c
Log Message:
Pull up following revision(s) (requested by ozaki-r in ticket #653):
sys/net/if_vlan.c: revision 1.80
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
To generate a diff of this commit:
cvs rdiff -u -r1.70.2.1 -r1.70.2.2 src/sys/net/if_vlan.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/net/if_vlan.c
diff -u src/sys/net/if_vlan.c:1.70.2.1 src/sys/net/if_vlan.c:1.70.2.2
--- src/sys/net/if_vlan.c:1.70.2.1 Mon Sep 22 10:44:37 2014
+++ src/sys/net/if_vlan.c Sat Apr 4 14:56:48 2015
@@ -1,4 +1,4 @@
-/* $NetBSD: if_vlan.c,v 1.70.2.1 2014/09/22 10:44:37 martin Exp $ */
+/* $NetBSD: if_vlan.c,v 1.70.2.2 2015/04/04 14:56:48 martin 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.70.2.1 2014/09/22 10:44:37 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vlan.c,v 1.70.2.2 2015/04/04 14:56:48 martin Exp $");
#include "opt_inet.h"
@@ -791,9 +791,10 @@ vlan_start(struct ifnet *ifp)
* 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);