Source-Changes-HG archive

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

[src/trunk]: src/sys remove unnecessary if_vlanvar.h. add missing include "vl...



details:   https://anonhg.NetBSD.org/src/rev/d715bdc7f05e
branches:  trunk
changeset: 822740:d715bdc7f05e
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Tue Apr 04 10:25:38 2017 +0000

description:
remove unnecessary if_vlanvar.h. add missing include "vlan.h".

pointed out by s-yamaguchi@IIJ, thanks.

diffstat:

 sys/net/if_l2tp.c       |  11 ++++++++---
 sys/netinet6/in6_l2tp.c |   6 ++----
 2 files changed, 10 insertions(+), 7 deletions(-)

diffs (85 lines):

diff -r bc977fe580d5 -r d715bdc7f05e sys/net/if_l2tp.c
--- a/sys/net/if_l2tp.c Tue Apr 04 09:53:02 2017 +0000
+++ b/sys/net/if_l2tp.c Tue Apr 04 10:25:38 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_l2tp.c,v 1.5 2017/04/04 04:34:43 knakahara Exp $    */
+/*     $NetBSD: if_l2tp.c,v 1.6 2017/04/04 10:25:38 knakahara Exp $    */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -31,12 +31,14 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.5 2017/04/04 04:34:43 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_l2tp.c,v 1.6 2017/04/04 10:25:38 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
 #endif
 
+#include "vlan.h"
+
 #include <sys/param.h>
 #include <sys/systm.h>
 #include <sys/kernel.h>
@@ -67,7 +69,6 @@
 #include <net/netisr.h>
 #include <net/route.h>
 #include <net/bpf.h>
-#include <net/if_vlanvar.h>
 
 #include <netinet/in.h>
 #include <netinet/in_systm.h>
@@ -1390,13 +1391,16 @@
 
        if (l2tp_need_tcpmss_clamp(ifp)) {
                struct ether_header *eh;
+#if NVLAN > 0
                struct ether_vlan_header evh;
+#endif
 
                /* save ether header */
                m_copydata(m, 0, sizeof(evh), (void *)&evh);
                eh = (struct ether_header *)&evh;
 
                switch (ntohs(eh->ether_type)) {
+#if NVLAN > 0
                case ETHERTYPE_VLAN: /* Ether + VLAN */
                        if (m->m_pkthdr.len <= sizeof(struct ether_vlan_header))
                                break;
@@ -1426,6 +1430,7 @@
                                return NULL;
                        *mtod(m, struct ether_vlan_header *) = evh;
                        break;
+#endif /* NVLAN > 0 */
 #ifdef INET
                case ETHERTYPE_IP: /* Ether + IPv4 */
                        if (m->m_pkthdr.len <= sizeof(struct ether_header))
diff -r bc977fe580d5 -r d715bdc7f05e sys/netinet6/in6_l2tp.c
--- a/sys/netinet6/in6_l2tp.c   Tue Apr 04 09:53:02 2017 +0000
+++ b/sys/netinet6/in6_l2tp.c   Tue Apr 04 10:25:38 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: in6_l2tp.c,v 1.2 2017/03/30 23:13:54 knakahara Exp $   */
+/*     $NetBSD: in6_l2tp.c,v 1.3 2017/04/04 10:25:38 knakahara Exp $   */
 
 /*
  * Copyright (c) 2017 Internet Initiative Japan Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: in6_l2tp.c,v 1.2 2017/03/30 23:13:54 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: in6_l2tp.c,v 1.3 2017/04/04 10:25:38 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_l2tp.h"
@@ -64,8 +64,6 @@
 #include <altq/altq.h>
 #endif
 
-#include <net/if_vlanvar.h>
-
 /* TODO: IP_TCPMSS support */
 #undef IP_TCPMSS
 #ifdef IP_TCPMSS



Home | Main Index | Thread Index | Old Index