summaryrefslogtreecommitdiff
path: root/sys/net
diff options
context:
space:
mode:
authorSebastian Benoit <benno@cvs.openbsd.org>2012-10-21 13:06:04 +0000
committerSebastian Benoit <benno@cvs.openbsd.org>2012-10-21 13:06:04 +0000
commit13f32dc0f32386032d455dd5fdf1dfd69753bc9b (patch)
tree7bc9068d988d2f743617f60fc94410b009530734 /sys/net
parent036204675e038878c1b3a43a17ff283b77e9d7ee (diff)
Add the IP_DIVERTFL socket option on divert(4) sockets to control
which packets (as in direction) of the traffic will be diverted through the divert socket. ok claudio@, henning@
Diffstat (limited to 'sys/net')
-rw-r--r--sys/net/pf.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/net/pf.c b/sys/net/pf.c
index 58742d22ae5..f8fd5774176 100644
--- a/sys/net/pf.c
+++ b/sys/net/pf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf.c,v 1.812 2012/09/19 12:35:07 blambert Exp $ */
+/* $OpenBSD: pf.c,v 1.813 2012/10/21 13:06:02 benno Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -6973,15 +6973,16 @@ done:
case PF_DIVERT:
switch (pd.af) {
case AF_INET:
- divert_packet(pd.m, pd.dir);
+ if (divert_packet(pd.m, pd.dir) == 0)
+ *m0 = NULL;
break;
#ifdef INET6
case AF_INET6:
- divert6_packet(pd.m, pd.dir);
+ if (divert6_packet(pd.m, pd.dir) == 0)
+ *m0 = NULL;
break;
#endif /* INET6 */
}
- *m0 = NULL;
action = PF_PASS;
break;
#if INET && INET6