diff options
author | 2017-10-06 22:08:30 +0000 | |
---|---|---|
committer | 2017-10-06 22:08:30 +0000 | |
commit | ebfd7b7233ddf60aee62bc74a8272dbc0db38ade (patch) | |
tree | b72f6adbaf9f75e49f57f0fba2b537a5a66b60c0 /sys/netinet6 | |
parent | Kill the divert-packet socket option IP_DIVERTFL to filter packets. (diff) | |
download | wireguard-openbsd-ebfd7b7233ddf60aee62bc74a8272dbc0db38ade.tar.xz wireguard-openbsd-ebfd7b7233ddf60aee62bc74a8272dbc0db38ade.zip |
Unfortunately I removed too much in my previous commit and broke
divert-packet. Bring back the loop over the global list to find
the divert socket.
Diffstat (limited to 'sys/netinet6')
-rw-r--r-- | sys/netinet6/ip6_divert.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet6/ip6_divert.c b/sys/netinet6/ip6_divert.c index dec7634da9d..011514a521e 100644 --- a/sys/netinet6/ip6_divert.c +++ b/sys/netinet6/ip6_divert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip6_divert.c,v 1.52 2017/10/06 21:14:55 bluhm Exp $ */ +/* $OpenBSD: ip6_divert.c,v 1.53 2017/10/06 22:08:30 bluhm Exp $ */ /* * Copyright (c) 2009 Michele Marchetto <michele@openbsd.org> @@ -190,6 +190,11 @@ divert6_packet(struct mbuf *m, int dir, u_int16_t divert_port) return (0); } + TAILQ_FOREACH(inp, &divb6table.inpt_queue, inp_queue) { + if (inp->inp_lport == divert_port) + break; + } + memset(&addr, 0, sizeof(addr)); addr.sin6_family = AF_INET6; addr.sin6_len = sizeof(addr); |