summaryrefslogtreecommitdiffstats
path: root/sys/net/pf_lb.c
diff options
context:
space:
mode:
authorbluhm <bluhm@openbsd.org>2012-02-03 01:57:50 +0000
committerbluhm <bluhm@openbsd.org>2012-02-03 01:57:50 +0000
commitf1029a736aa24c8be37f67e98806279dee97d787 (patch)
tree73c6849ad9a72b26e0fb6c9f7f60d177bf4f8442 /sys/net/pf_lb.c
parentDocument option values, particularly that omitting on|off for a flag is (diff)
downloadwireguard-openbsd-f1029a736aa24c8be37f67e98806279dee97d787.tar.xz
wireguard-openbsd-f1029a736aa24c8be37f67e98806279dee97d787.zip
The kernel did not compile without INET6. Put some #ifdefs into
pf to fix that. - add #ifdef INET6 in obvious places - af translation is only possible with both INET and INET6 - interleave #endif /* INET6 */ and closing brace correctly - it is not necessary to #ifdef function prototypes - do not compile af translate functions at all instead of empty stub, then the linker will report inconsistencies - pf_poolmask() actually takes an sa_family_t not an u_int8_t argument No binary change for GENERIC compiled with -O2 and -UDIAGNOSTIC. reported by Olivier Cochard-Labbe; ok mikeb@ henning@
Diffstat (limited to 'sys/net/pf_lb.c')
-rw-r--r--sys/net/pf_lb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/net/pf_lb.c b/sys/net/pf_lb.c
index 6082cb905ef..a88bce0f669 100644
--- a/sys/net/pf_lb.c
+++ b/sys/net/pf_lb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_lb.c,v 1.19 2011/10/13 18:23:40 claudio Exp $ */
+/* $OpenBSD: pf_lb.c,v 1.20 2012/02/03 01:57:51 bluhm Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -582,8 +582,10 @@ pf_get_transaddr(struct pf_rule *r, struct pf_pdesc *pd,
struct pf_addr naddr;
u_int16_t nport = 0;
+#ifdef INET6
if (pd->af != pd->naf)
return (pf_get_transaddr_af(r, pd, sns));
+#endif /* INET6 */
if (r->nat.addr.type != PF_ADDR_NONE) {
/* XXX is this right? what if rtable is changed at the same
@@ -632,6 +634,7 @@ pf_get_transaddr(struct pf_rule *r, struct pf_pdesc *pd,
return (0);
}
+#ifdef INET6
int
pf_get_transaddr_af(struct pf_rule *r, struct pf_pdesc *pd,
struct pf_src_node **sns)
@@ -760,6 +763,7 @@ pf_get_transaddr_af(struct pf_rule *r, struct pf_pdesc *pd,
return (0);
}
+#endif /* INET6 */
int
pf_postprocess_addr(struct pf_state *cur) {