summaryrefslogtreecommitdiffstats
path: root/lib/if.h
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-01-05 15:21:55 +0100
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-01-12 15:19:43 +0100
commit14fcc65cbbcd3d1684b879a10a0d8564c238e0e6 (patch)
tree6ea11723710bc2f05b4258a45ef152250a98374a /lib/if.h
parentlib: Add notice of when we can remove some deprecated code. (diff)
downloadfrr-14fcc65cbbcd3d1684b879a10a0d8564c238e0e6.tar.xz
frr-14fcc65cbbcd3d1684b879a10a0d8564c238e0e6.zip
lib: Allow interface lookup by VRF_UNKNOWN
Modify if_lookup_by_index to accept a VRF_UNKNOWN as a vrf_id. This will cause it to look in all vrf's for the interface pointer. Subsequently all if_XXXX functions that call this function will also get this behavior. VRF_UNKNOWN *should* not be used for interface creation as that this will break some core assumptions. This work is part of allowing vrf route leaking. Currently it is possible to create a route in the linux kernel that has a nexthop across vrf boundaries. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'lib/if.h')
-rw-r--r--lib/if.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/if.h b/lib/if.h
index eb8af2041..79f96a7c4 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -452,6 +452,13 @@ struct nbr_connected {
/* Prototypes. */
extern int if_cmp_name_func(char *, char *);
+/*
+ * Passing in VRF_UNKNOWN is a valid thing to do, unless we
+ * are creating a new interface.
+ *
+ * This is useful for vrf route-leaking. So more than anything
+ * else think before you use VRF_UNKNOWN
+ */
extern void if_update_to_new_vrf(struct interface *, vrf_id_t vrf_id);
extern struct interface *if_create(const char *name, vrf_id_t vrf_id);
extern struct interface *if_lookup_by_index(ifindex_t, vrf_id_t vrf_id);