mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 00:50:03 +00:00
lib, pimd, zebra: Convert if_lookup_exact_address to VRF only
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
4e5266b8a3
commit
c5e2cb11ad
8
lib/if.c
8
lib/if.c
@ -339,7 +339,7 @@ if_lookup_by_name_len(const char *name, size_t namelen)
|
|||||||
|
|
||||||
/* Lookup interface by IPv4 address. */
|
/* Lookup interface by IPv4 address. */
|
||||||
struct interface *
|
struct interface *
|
||||||
if_lookup_exact_address_vrf (void *src, int family, vrf_id_t vrf_id)
|
if_lookup_exact_address (void *src, int family, vrf_id_t vrf_id)
|
||||||
{
|
{
|
||||||
struct listnode *node;
|
struct listnode *node;
|
||||||
struct listnode *cnode;
|
struct listnode *cnode;
|
||||||
@ -371,12 +371,6 @@ if_lookup_exact_address_vrf (void *src, int family, vrf_id_t vrf_id)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct interface *
|
|
||||||
if_lookup_exact_address (void *src, int family)
|
|
||||||
{
|
|
||||||
return if_lookup_exact_address_vrf (src, family, VRF_DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Lookup interface by IPv4 address. */
|
/* Lookup interface by IPv4 address. */
|
||||||
struct connected *
|
struct connected *
|
||||||
if_lookup_address_vrf (void *matchaddr, int family, vrf_id_t vrf_id)
|
if_lookup_address_vrf (void *matchaddr, int family, vrf_id_t vrf_id)
|
||||||
|
3
lib/if.h
3
lib/if.h
@ -389,7 +389,6 @@ struct nbr_connected
|
|||||||
|
|
||||||
/* Prototypes. */
|
/* Prototypes. */
|
||||||
extern int if_cmp_name_func (char *, char *);
|
extern int if_cmp_name_func (char *, char *);
|
||||||
extern struct interface *if_lookup_exact_address (void *matchaddr, int family);
|
|
||||||
extern struct connected *if_lookup_address (void *matchaddr, int family);
|
extern struct connected *if_lookup_address (void *matchaddr, int family);
|
||||||
extern struct interface *if_lookup_prefix (struct prefix *prefix);
|
extern struct interface *if_lookup_prefix (struct prefix *prefix);
|
||||||
|
|
||||||
@ -398,7 +397,7 @@ extern void if_update_vrf (struct interface *, const char *name, int namelen,
|
|||||||
extern struct interface *if_create (const char *name, int namelen,
|
extern struct interface *if_create (const char *name, int namelen,
|
||||||
vrf_id_t vrf_id);
|
vrf_id_t vrf_id);
|
||||||
extern struct interface *if_lookup_by_index (ifindex_t, vrf_id_t vrf_id);
|
extern struct interface *if_lookup_by_index (ifindex_t, vrf_id_t vrf_id);
|
||||||
extern struct interface *if_lookup_exact_address_vrf (void *matchaddr, int family,
|
extern struct interface *if_lookup_exact_address (void *matchaddr, int family,
|
||||||
vrf_id_t vrf_id);
|
vrf_id_t vrf_id);
|
||||||
extern struct connected *if_lookup_address_vrf (void *matchaddr, int family,
|
extern struct connected *if_lookup_address_vrf (void *matchaddr, int family,
|
||||||
vrf_id_t vrf_id);
|
vrf_id_t vrf_id);
|
||||||
|
@ -752,7 +752,7 @@ pim_rp_check_is_my_ip_address (struct in_addr group, struct in_addr dest_addr)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (if_lookup_exact_address (&dest_addr, AF_INET))
|
if (if_lookup_exact_address (&dest_addr, AF_INET, VRF_DEFAULT))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -255,7 +255,7 @@ rip2IfLookup (struct variable *v, oid name[], size_t *length,
|
|||||||
|
|
||||||
oid2in_addr (name + v->namelen, sizeof (struct in_addr), addr);
|
oid2in_addr (name + v->namelen, sizeof (struct in_addr), addr);
|
||||||
|
|
||||||
return if_lookup_exact_address ((void *)addr, AF_INET);
|
return if_lookup_exact_address ((void *)addr, AF_INET, VRF_DEFAULT);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -375,11 +375,11 @@ DEFUN (set_src,
|
|||||||
RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
|
RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
|
||||||
{
|
{
|
||||||
if (family == AF_INET)
|
if (family == AF_INET)
|
||||||
pif = if_lookup_exact_address_vrf ((void *)&src.ipv4, AF_INET,
|
pif = if_lookup_exact_address ((void *)&src.ipv4, AF_INET,
|
||||||
vrf->vrf_id);
|
vrf->vrf_id);
|
||||||
else if (family == AF_INET6)
|
else if (family == AF_INET6)
|
||||||
pif = if_lookup_exact_address_vrf ((void *)&src.ipv6, AF_INET6,
|
pif = if_lookup_exact_address ((void *)&src.ipv6, AF_INET6,
|
||||||
vrf->vrf_id);
|
vrf->vrf_id);
|
||||||
|
|
||||||
if (pif != NULL)
|
if (pif != NULL)
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user