summaryrefslogtreecommitdiff
path: root/sys/netinet/ipsec_output.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-02 12:39:16 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2021-12-02 12:39:16 +0000
commit50a2dcd14345dac2a5e224a856d00dd13be4f8aa (patch)
tree29d42c79760caaadb988f184f76009f5dac7c86c /sys/netinet/ipsec_output.c
parent953b5678cbcdd918247f379b24743bc3f759891c (diff)
Allow to build kernel without IPSEC or INET6 defines.
OK mpi@ mvs@
Diffstat (limited to 'sys/netinet/ipsec_output.c')
-rw-r--r--sys/netinet/ipsec_output.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/netinet/ipsec_output.c b/sys/netinet/ipsec_output.c
index 7c8064a240b..621755318d0 100644
--- a/sys/netinet/ipsec_output.c
+++ b/sys/netinet/ipsec_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_output.c,v 1.92 2021/11/25 13:46:02 bluhm Exp $ */
+/* $OpenBSD: ipsec_output.c,v 1.93 2021/12/02 12:39:15 bluhm Exp $ */
/*
* The author of this code is Angelos D. Keromytis (angelos@cis.upenn.edu)
*
@@ -162,13 +162,16 @@ ipsp_process_packet(struct mbuf *m, struct tdb *tdb, int af, int tunalready)
* doing tunneling.
*/
if (af == tdb->tdb_dst.sa.sa_family) {
- if (af == AF_INET)
+ switch (af) {
+ case AF_INET:
hlen = sizeof(struct ip);
-
+ break;
#ifdef INET6
- if (af == AF_INET6)
+ case AF_INET6:
hlen = sizeof(struct ip6_hdr);
+ break;
#endif /* INET6 */
+ }
/* Bring the network header in the first mbuf. */
if (m->m_len < hlen) {