summaryrefslogtreecommitdiffstats
path: root/sys/net/pf_lb.c
diff options
context:
space:
mode:
authoryasuoka <yasuoka@openbsd.org>2019-07-02 09:04:53 +0000
committeryasuoka <yasuoka@openbsd.org>2019-07-02 09:04:53 +0000
commitb4470a7bf787a11ce971643e7df7f69db5a3d1ba (patch)
treea1fcd4d457008826dbb1063cd8a9a84dbd931cbc /sys/net/pf_lb.c
parentUse IPL_TTY for locks used as arguments to spin_lock_irq() and (diff)
downloadwireguard-openbsd-b4470a7bf787a11ce971643e7df7f69db5a3d1ba.tar.xz
wireguard-openbsd-b4470a7bf787a11ce971643e7df7f69db5a3d1ba.zip
When source address tracking record is used for "route-to", the next
hop interface configured with "route-to" was not used. Keep the interface within the pf_src_node and use it when the record is used. OK sashan
Diffstat (limited to 'sys/net/pf_lb.c')
-rw-r--r--sys/net/pf_lb.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/net/pf_lb.c b/sys/net/pf_lb.c
index 174d5a721b7..255046e9446 100644
--- a/sys/net/pf_lb.c
+++ b/sys/net/pf_lb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pf_lb.c,v 1.63 2018/12/10 16:48:15 kn Exp $ */
+/* $OpenBSD: pf_lb.c,v 1.64 2019/07/02 09:04:53 yasuoka Exp $ */
/*
* Copyright (c) 2001 Daniel Hartmeier
@@ -329,6 +329,10 @@ pf_map_addr_sticky(sa_family_t af, struct pf_rule *r, struct pf_addr *saddr,
pf_print_host(naddr, 0, af);
addlog("\n");
}
+
+ if (sns[type]->kif != NULL)
+ rpool->kif = sns[type]->kif;
+
return (0);
}
@@ -618,7 +622,8 @@ pf_map_addr(sa_family_t af, struct pf_rule *r, struct pf_addr *saddr,
pf_remove_src_node(sns[type]);
sns[type] = NULL;
}
- if (pf_insert_src_node(&sns[type], r, type, af, saddr, naddr))
+ if (pf_insert_src_node(&sns[type], r, type, af, saddr, naddr,
+ rpool->kif))
return (1);
}