mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 03:27:25 +00:00
lib, zebra: Move nh_resolve_via_default to appropriate header
The nh_resolve_via_default function is an accessor function for NHT in zebra. Let's move this function to it's proper place. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
4a7371e9e2
commit
44bdf1590d
@ -121,18 +121,6 @@ struct nexthop {
|
|||||||
(nexthop); \
|
(nexthop); \
|
||||||
(nexthop) = nexthop_next(nexthop)
|
(nexthop) = nexthop_next(nexthop)
|
||||||
|
|
||||||
extern int zebra_rnh_ip_default_route;
|
|
||||||
extern int zebra_rnh_ipv6_default_route;
|
|
||||||
|
|
||||||
static inline int nh_resolve_via_default(int family)
|
|
||||||
{
|
|
||||||
if (((family == AF_INET) && zebra_rnh_ip_default_route)
|
|
||||||
|| ((family == AF_INET6) && zebra_rnh_ipv6_default_route))
|
|
||||||
return 1;
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
struct nexthop *nexthop_new(void);
|
struct nexthop *nexthop_new(void);
|
||||||
void nexthop_add(struct nexthop **target, struct nexthop *nexthop);
|
void nexthop_add(struct nexthop **target, struct nexthop *nexthop);
|
||||||
|
|
||||||
|
@ -484,7 +484,7 @@ static int nexthop_active(afi_t afi, struct route_entry *re,
|
|||||||
/* However, do not resolve over default route unless explicitly
|
/* However, do not resolve over default route unless explicitly
|
||||||
* allowed. */
|
* allowed. */
|
||||||
if (is_default_prefix(&rn->p)
|
if (is_default_prefix(&rn->p)
|
||||||
&& !nh_resolve_via_default(p.family))
|
&& !rnh_resolve_via_default(p.family))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
dest = rib_dest_from_rnode(rn);
|
dest = rib_dest_from_rnode(rn);
|
||||||
|
@ -659,7 +659,7 @@ static struct route_entry *zebra_rnh_resolve_nexthop_entry(vrf_id_t vrfid,
|
|||||||
* match route to be exact if so specified
|
* match route to be exact if so specified
|
||||||
*/
|
*/
|
||||||
if (is_default_prefix(&rn->p) &&
|
if (is_default_prefix(&rn->p) &&
|
||||||
!nh_resolve_via_default(rn->p.family))
|
!rnh_resolve_via_default(rn->p.family))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Identify appropriate route entry. */
|
/* Identify appropriate route entry. */
|
||||||
|
@ -54,6 +54,15 @@ typedef enum { RNH_NEXTHOP_TYPE, RNH_IMPORT_CHECK_TYPE } rnh_type_t;
|
|||||||
extern int zebra_rnh_ip_default_route;
|
extern int zebra_rnh_ip_default_route;
|
||||||
extern int zebra_rnh_ipv6_default_route;
|
extern int zebra_rnh_ipv6_default_route;
|
||||||
|
|
||||||
|
static inline int rnh_resolve_via_default(int family)
|
||||||
|
{
|
||||||
|
if (((family == AF_INET) && zebra_rnh_ip_default_route)
|
||||||
|
|| ((family == AF_INET6) && zebra_rnh_ipv6_default_route))
|
||||||
|
return 1;
|
||||||
|
else
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid,
|
extern struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid,
|
||||||
rnh_type_t type);
|
rnh_type_t type);
|
||||||
extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid,
|
extern struct rnh *zebra_lookup_rnh(struct prefix *p, vrf_id_t vrfid,
|
||||||
|
Loading…
Reference in New Issue
Block a user