Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-7]: src/sys/net Pull up following revision(s) (requested by ozaki...



details:   https://anonhg.NetBSD.org/src/rev/fd95c9ac2378
branches:  netbsd-7
changeset: 799164:fd95c9ac2378
user:      martin <martin%NetBSD.org@localhost>
date:      Sat Apr 04 14:56:48 2015 +0000

description:
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

diffstat:

 sys/net/if_vlan.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r 425c16afa7c0 -r fd95c9ac2378 sys/net/if_vlan.c
--- a/sys/net/if_vlan.c Sun Mar 29 09:09:50 2015 +0000
+++ b/sys/net/if_vlan.c Sat Apr 04 14:56:48 2015 +0000
@@ -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 @@
                                 * 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