summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2018-02-27 09:24:57 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2018-02-27 09:24:57 +0000
commitac17fea52ddda21a9c01035ac2bd32a7dcb43b4c (patch)
treee2e4b60f075542298c17766ddb6847bbf88e7e2a /sys/net
parentf8221f39fa9c9faef541d044b9caacdc8fd7db7e (diff)
make kernel compile again without INET6
ok mpi@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/if_ethersubr.c4
-rw-r--r--sys/net/if_gre.c7
-rw-r--r--sys/net/pf.c6
3 files changed, 14 insertions, 3 deletions
diff --git a/sys/net/if_ethersubr.c b/sys/net/if_ethersubr.c
index 548cf22a305..00c506bd343 100644
--- a/sys/net/if_ethersubr.c
+++ b/sys/net/if_ethersubr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ethersubr.c,v 1.251 2018/02/02 22:00:39 bluhm Exp $ */
+/* $OpenBSD: if_ethersubr.c,v 1.252 2018/02/27 09:24:56 benno Exp $ */
/* $NetBSD: if_ethersubr.c,v 1.19 1996/05/07 02:40:30 thorpej Exp $ */
/*
@@ -248,11 +248,13 @@ ether_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
memcpy(edst, LLADDR(satosdl(dst)),
sizeof(edst));
break;
+#ifdef INET6
case AF_INET6:
error = nd6_resolve(ifp, rt, m, dst, edst);
if (error)
return (error == EAGAIN ? 0 : error);
break;
+#endif
case AF_INET:
case AF_MPLS:
error = arpresolve(ifp, rt, m, dst, edst);
diff --git a/sys/net/if_gre.c b/sys/net/if_gre.c
index c61570c3f5e..dbe96c8fb8e 100644
--- a/sys/net/if_gre.c
+++ b/sys/net/if_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gre.c,v 1.117 2018/02/27 06:46:00 dlg Exp $ */
+/* $OpenBSD: if_gre.c,v 1.118 2018/02/27 09:24:56 benno Exp $ */
/* $NetBSD: if_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -2376,8 +2376,13 @@ gre_keepalive_send(void *arg)
return;
/* this is really conservative */
+#ifdef INET6
linkhdr = max_linkhdr + MAX(sizeof(struct ip), sizeof(struct ip6_hdr)) +
sizeof(struct gre_header) + sizeof(struct gre_h_key);
+#else
+ linkhdr = max_linkhdr + sizeof(struct ip) +
+ sizeof(struct gre_header) + sizeof(struct gre_h_key);
+#endif
len = linkhdr + sizeof(*gk);
MGETHDR(m, M_DONTWAIT, MT_DATA);
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 51c02a5eaa7..40d3009040f 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.1061 2018/02/18 21:45:30 sashan Exp $ */
+/* $OpenBSD: pf.c,v 1.1062 2018/02/27 09:24:56 benno Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -319,8 +319,10 @@ static __inline int pf_state_compare_key(struct pf_state_key *,
struct pf_state_key *);
static __inline int pf_state_compare_id(struct pf_state *,
struct pf_state *);
+#ifdef INET6
static __inline void pf_cksum_uncover(u_int16_t *, u_int16_t, u_int8_t);
static __inline void pf_cksum_cover(u_int16_t *, u_int16_t, u_int8_t);
+#endif /* INET6 */
static __inline void pf_set_protostate(struct pf_state *, int, u_int8_t);
struct pf_src_tree tree_src_tracking;
@@ -1816,6 +1818,7 @@ pf_cksum_fixup(u_int16_t *cksum, u_int16_t was, u_int16_t now,
*cksum = (u_int16_t)(x);
}
+#ifdef INET6
/* pre: coverage(cksum) is superset of coverage(covered_cksum) */
static __inline void
pf_cksum_uncover(u_int16_t *cksum, u_int16_t covered_cksum, u_int8_t proto)
@@ -1829,6 +1832,7 @@ pf_cksum_cover(u_int16_t *cksum, u_int16_t uncovered_cksum, u_int8_t proto)
{
pf_cksum_fixup(cksum, 0x0, ~uncovered_cksum, proto);
}
+#endif /* INET6 */
/* pre: *a is 16-bit aligned within its packet
*