summaryrefslogtreecommitdiffstats
path: root/pbrd/pbr_main.c
diff options
context:
space:
mode:
authorStephen Worley <sworley@cumulusnetworks.com>2019-09-27 22:38:31 +0200
committerStephen Worley <sworley@cumulusnetworks.com>2019-11-21 22:59:42 +0100
commitbe3b67b5ef82d2f1f9f0f63190dd65c2bc47ebbf (patch)
tree47fdc3253148c9b0e9f31ebf8e71afcc7993e99f /pbrd/pbr_main.c
parentMerge pull request #5398 from taspelund/missed_newline (diff)
downloadfrr-be3b67b5ef82d2f1f9f0f63190dd65c2bc47ebbf.tar.xz
frr-be3b67b5ef82d2f1f9f0f63190dd65c2bc47ebbf.zip
pbrd: Add `set vrf NAME` and `set vrf unchanged`
`set vrf NAME` allows the pbr map to point to an arbitrary vrf table. `set vrf unchanged` will use the interface's vrf for table lookup. Further, add functionality for pbr to respond to interface events such as interface vrf changes & interface creation/deletion. Ex) ubuntu_nh# show pbr map pbr-map TEST valid: 1 Seq: 1 rule: 300 Installed: 3(1) Reason: Valid SRC Match: 3.3.3.3/32 VRF Unchanged (use interface vrf) pbr-map TEST2 valid: 1 Seq: 2 rule: 301 Installed: 3(2) Reason: Valid SRC Match: 4.4.4.4/32 VRF Lookup: vrf-red root@ubuntu_nh:/home# ip rule show 0: from all lookup local 300: from 3.3.3.3 iif dummy2 lookup main 300: from 3.3.3.3 iif dummyVRF lookup 1111 301: from 4.4.4.4 iif dummy1 lookup 1111 301: from 4.4.4.4 iif dummy3 lookup 1111 Signed-off-by: Stephen Worley <sworley@cumulusnetworks.com-
Diffstat (limited to 'pbrd/pbr_main.c')
-rw-r--r--pbrd/pbr_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pbrd/pbr_main.c b/pbrd/pbr_main.c
index bb92703ae..faa3de42f 100644
--- a/pbrd/pbr_main.c
+++ b/pbrd/pbr_main.c
@@ -48,6 +48,7 @@
#include "pbr_zebra.h"
#include "pbr_vty.h"
#include "pbr_debug.h"
+#include "pbr_vrf.h"
zebra_capabilities_t _caps_p[] = {
ZCAP_NET_RAW, ZCAP_BIND, ZCAP_NET_ADMIN,
@@ -153,7 +154,6 @@ int main(int argc, char **argv, char **envp)
pbr_debug_init();
- vrf_init(NULL, NULL, NULL, NULL, NULL);
nexthop_group_init(pbr_nhgroup_add_cb,
pbr_nhgroup_add_nexthop_cb,
pbr_nhgroup_del_nexthop_cb,
@@ -169,6 +169,7 @@ int main(int argc, char **argv, char **envp)
if_zapi_callbacks(pbr_ifp_create, pbr_ifp_up,
pbr_ifp_down, pbr_ifp_destroy);
pbr_zebra_init();
+ pbr_vrf_init();
pbr_vty_init();
frr_config_fork();