NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/49788: vlan(4) extra padding
>Number: 49788
>Category: kern
>Synopsis: vlan(4) extra padding
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 26 08:15:00 +0000 2015
>Originator: Ryota Ozaki
>Release: current
>Organization:
IIJ
>Environment:
NetBSD kvm 7.99.7 NetBSD 7.99.7 (KVM) #141: Thu Mar 26 15:16:00 JST 2015 ozaki-r@rangeley:(hidden) amd64
>Description:
http://nxr.netbsd.org/xref/src/sys/net/if_vlan.c#808
Here vlan pads a frame with zeros up to 68 bytes
(ETHER_MIN_LEN + ETHER_VLAN_ENCAP_LEN). It expects
that if the frame is untagged, it keeps 64 bytes
at least. However, it lacks concern about CRC
(4 bytes). So a sending frame will be 72 (68 + 4) bytes.
>How-To-Repeat:
Create and set up a vlan interface, ping to somewhere via it and see packet size.
>Fix:
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 2d5b861..02b6686 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -806,9 +806,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);
Home |
Main Index |
Thread Index |
Old Index