summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_zebra.c2
-rw-r--r--isisd/isis_circuit.c4
-rw-r--r--lib/if.c7
-rw-r--r--lib/if.h4
-rw-r--r--ospf6d/ospf6_interface.c10
-rw-r--r--ospfd/ospf_interface.c6
-rw-r--r--pimd/pim_jp_agg.c2
-rw-r--r--pimd/pim_pim.c4
-rw-r--r--pimd/pim_vxlan.c2
-rw-r--r--pimd/pim_vxlan.h2
-rw-r--r--zebra/connected.c2
-rw-r--r--zebra/rtadv.c22
-rw-r--r--zebra/zebra_rib.c4
13 files changed, 36 insertions, 35 deletions
diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c
index a98168d46..bedd480c1 100644
--- a/bgpd/bgp_zebra.c
+++ b/bgpd/bgp_zebra.c
@@ -875,7 +875,7 @@ bool bgp_zebra_nexthop_set(union sockunion *local, union sockunion *remote,
* It's fine to not have a v6 LL when using
* update-source loopback/vrf
*/
- if (!v6_ll_avail && if_is_loopback_or_vrf(ifp))
+ if (!v6_ll_avail && if_is_loopback(ifp))
v6_ll_avail = true;
} else
/* Link-local address. */
diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c
index d0e8637c5..2fe89db2b 100644
--- a/isisd/isis_circuit.c
+++ b/isisd/isis_circuit.c
@@ -487,7 +487,7 @@ void isis_circuit_if_add(struct isis_circuit *circuit, struct interface *ifp)
circuit->circ_type = CIRCUIT_T_BROADCAST;
} else if (if_is_pointopoint(ifp)) {
circuit->circ_type = CIRCUIT_T_P2P;
- } else if (if_is_loopback_or_vrf(ifp)) {
+ } else if (if_is_loopback(ifp)) {
circuit->circ_type = CIRCUIT_T_LOOPBACK;
circuit->is_passive = 1;
} else {
@@ -1305,7 +1305,7 @@ ferr_r isis_circuit_passive_set(struct isis_circuit *circuit, bool passive)
if (circuit->is_passive == passive)
return ferr_ok();
- if (if_is_loopback_or_vrf(circuit->interface) && !passive)
+ if (if_is_loopback(circuit->interface) && !passive)
return ferr_cfg_invalid("loopback is always passive");
if (circuit->state != C_STATE_UP) {
diff --git a/lib/if.c b/lib/if.c
index 6bfbdf914..c000c3165 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -713,7 +713,7 @@ int if_is_no_ptm_operative(const struct interface *ifp)
}
/* Is this loopback interface ? */
-int if_is_loopback(const struct interface *ifp)
+int if_is_loopback_exact(const struct interface *ifp)
{
/* XXX: Do this better, eg what if IFF_WHATEVER means X on platform M
* but Y on platform N?
@@ -727,9 +727,10 @@ int if_is_vrf(const struct interface *ifp)
return CHECK_FLAG(ifp->status, ZEBRA_INTERFACE_VRF_LOOPBACK);
}
-bool if_is_loopback_or_vrf(const struct interface *ifp)
+/* Should this interface be treated as a loopback? */
+bool if_is_loopback(const struct interface *ifp)
{
- if (if_is_loopback(ifp) || if_is_vrf(ifp))
+ if (if_is_loopback_exact(ifp) || if_is_vrf(ifp))
return true;
return false;
diff --git a/lib/if.h b/lib/if.h
index 5f0dc2755..f52e7cb20 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -548,9 +548,9 @@ extern int if_is_up(const struct interface *ifp);
extern int if_is_running(const struct interface *ifp);
extern int if_is_operative(const struct interface *ifp);
extern int if_is_no_ptm_operative(const struct interface *ifp);
-extern int if_is_loopback(const struct interface *ifp);
+extern int if_is_loopback_exact(const struct interface *ifp);
extern int if_is_vrf(const struct interface *ifp);
-extern bool if_is_loopback_or_vrf(const struct interface *ifp);
+extern bool if_is_loopback(const struct interface *ifp);
extern int if_is_broadcast(const struct interface *ifp);
extern int if_is_pointopoint(const struct interface *ifp);
extern int if_is_multicast(const struct interface *ifp);
diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c
index 4205be38b..e83dc9c21 100644
--- a/ospf6d/ospf6_interface.c
+++ b/ospf6d/ospf6_interface.c
@@ -127,7 +127,7 @@ static uint8_t ospf6_default_iftype(struct interface *ifp)
{
if (if_is_pointopoint(ifp))
return OSPF_IFTYPE_POINTOPOINT;
- else if (if_is_loopback_or_vrf(ifp))
+ else if (if_is_loopback(ifp))
return OSPF_IFTYPE_LOOPBACK;
else
return OSPF_IFTYPE_BROADCAST;
@@ -387,7 +387,7 @@ void ospf6_interface_state_update(struct interface *ifp)
if (if_is_operative(ifp)
&& (ospf6_interface_get_linklocal_address(oi->interface)
- || if_is_loopback_or_vrf(oi->interface)))
+ || if_is_loopback(oi->interface)))
thread_execute(master, interface_up, oi, 0);
else
thread_execute(master, interface_down, oi, 0);
@@ -750,7 +750,7 @@ int interface_up(struct thread *thread)
/* check interface has a link-local address */
if (!(ospf6_interface_get_linklocal_address(oi->interface)
- || if_is_loopback_or_vrf(oi->interface))) {
+ || if_is_loopback(oi->interface))) {
zlog_warn(
"Interface %s has no link local address, can't execute [InterfaceUp]",
oi->interface->name);
@@ -819,7 +819,7 @@ int interface_up(struct thread *thread)
/* Schedule Hello */
if (!CHECK_FLAG(oi->flag, OSPF6_INTERFACE_PASSIVE)
- && !if_is_loopback_or_vrf(oi->interface)) {
+ && !if_is_loopback(oi->interface)) {
thread_add_event(master, ospf6_hello_send, oi, 0,
&oi->thread_send_hello);
}
@@ -2315,7 +2315,7 @@ DEFUN (no_ipv6_ospf6_passive,
THREAD_OFF(oi->thread_sso);
/* don't send hellos over loopback interface */
- if (!if_is_loopback_or_vrf(oi->interface))
+ if (!if_is_loopback(oi->interface))
thread_add_event(master, ospf6_hello_send, oi, 0,
&oi->thread_send_hello);
diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c
index 42d31414f..e2994a13c 100644
--- a/ospfd/ospf_interface.c
+++ b/ospfd/ospf_interface.c
@@ -477,7 +477,7 @@ struct ospf_interface *ospf_if_lookup_recv_if(struct ospf *ospf,
if (oi->type == OSPF_IFTYPE_VIRTUALLINK)
continue;
- if (if_is_loopback_or_vrf(oi->ifp))
+ if (if_is_loopback(oi->ifp))
continue;
if (CHECK_FLAG(oi->connected->flags, ZEBRA_IFA_UNNUMBERED))
@@ -719,7 +719,7 @@ static int ospf_if_delete_hook(struct interface *ifp)
int ospf_if_is_enable(struct ospf_interface *oi)
{
- if (!(if_is_loopback_or_vrf(oi->ifp)))
+ if (!(if_is_loopback(oi->ifp)))
if (if_is_up(oi->ifp))
return 1;
@@ -1294,7 +1294,7 @@ uint8_t ospf_default_iftype(struct interface *ifp)
{
if (if_is_pointopoint(ifp))
return OSPF_IFTYPE_POINTOPOINT;
- else if (if_is_loopback_or_vrf(ifp))
+ else if (if_is_loopback(ifp))
return OSPF_IFTYPE_LOOPBACK;
else
return OSPF_IFTYPE_BROADCAST;
diff --git a/pimd/pim_jp_agg.c b/pimd/pim_jp_agg.c
index d95d9dd25..5c6f55e99 100644
--- a/pimd/pim_jp_agg.c
+++ b/pimd/pim_jp_agg.c
@@ -368,7 +368,7 @@ void pim_jp_agg_single_upstream_send(struct pim_rpf *rpf,
if (!up || !rpf->source_nexthop.interface ||
pim_if_connected_to_source(rpf->source_nexthop.interface,
up->sg.src) ||
- if_is_loopback_or_vrf(rpf->source_nexthop.interface))
+ if_is_loopback(rpf->source_nexthop.interface))
return;
memset(&groups, 0, sizeof(groups));
diff --git a/pimd/pim_pim.c b/pimd/pim_pim.c
index 3df7dc41c..30dc6b3e9 100644
--- a/pimd/pim_pim.c
+++ b/pimd/pim_pim.c
@@ -692,7 +692,7 @@ int pim_hello_send(struct interface *ifp, uint16_t holdtime)
{
struct pim_interface *pim_ifp = ifp->info;
- if (if_is_loopback_or_vrf(ifp))
+ if (if_is_loopback(ifp))
return 0;
if (hello_send(ifp, holdtime)) {
@@ -794,7 +794,7 @@ void pim_hello_restart_triggered(struct interface *ifp)
/*
* No need to ever start loopback or vrf device hello's
*/
- if (if_is_loopback_or_vrf(ifp))
+ if (if_is_loopback(ifp))
return;
/*
diff --git a/pimd/pim_vxlan.c b/pimd/pim_vxlan.c
index e24f64792..4c8a96a84 100644
--- a/pimd/pim_vxlan.c
+++ b/pimd/pim_vxlan.c
@@ -1079,7 +1079,7 @@ void pim_vxlan_add_vif(struct interface *ifp)
if (pim->vrf->vrf_id != VRF_DEFAULT)
return;
- if (if_is_loopback_or_vrf(ifp))
+ if (if_is_loopback(ifp))
pim_vxlan_set_default_iif(pim, ifp);
if (vxlan_mlag.flags & PIM_VXLAN_MLAGF_ENABLED &&
diff --git a/pimd/pim_vxlan.h b/pimd/pim_vxlan.h
index ce9054cd2..d17de8e3d 100644
--- a/pimd/pim_vxlan.h
+++ b/pimd/pim_vxlan.h
@@ -116,7 +116,7 @@ static inline bool pim_vxlan_is_local_sip(struct pim_upstream *up)
{
return (up->sg.src.s_addr != INADDR_ANY) &&
up->rpf.source_nexthop.interface &&
- if_is_loopback_or_vrf(up->rpf.source_nexthop.interface);
+ if_is_loopback(up->rpf.source_nexthop.interface);
}
static inline bool pim_vxlan_is_term_dev_cfg(struct pim_instance *pim,
diff --git a/zebra/connected.c b/zebra/connected.c
index 80d434baf..80b6bf832 100644
--- a/zebra/connected.c
+++ b/zebra/connected.c
@@ -73,7 +73,7 @@ static void connected_announce(struct interface *ifp, struct connected *ifc)
if (!ifc)
return;
- if (!if_is_loopback_or_vrf(ifp) && ifc->address->family == AF_INET) {
+ if (!if_is_loopback(ifp) && ifc->address->family == AF_INET) {
if (ifc->address->prefixlen == IPV4_MAX_BITLEN)
SET_FLAG(ifc->flags, ZEBRA_IFA_UNNUMBERED);
else
diff --git a/zebra/rtadv.c b/zebra/rtadv.c
index ab3e55d10..4d97c3c23 100644
--- a/zebra/rtadv.c
+++ b/zebra/rtadv.c
@@ -493,7 +493,7 @@ static int rtadv_timer(struct thread *thread)
RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id)
FOR_ALL_INTERFACES (vrf, ifp) {
- if (if_is_loopback_or_vrf(ifp) || !if_is_operative(ifp)
+ if (if_is_loopback(ifp) || !if_is_operative(ifp)
|| (vrf_is_backend_netns() && ifp->vrf_id != zvrf->vrf->vrf_id))
continue;
@@ -726,7 +726,7 @@ static void rtadv_process_packet(uint8_t *buf, unsigned int len,
VRF_LOGNAME(vrf), ifp->ifindex, len, addr_str);
}
- if (if_is_loopback_or_vrf(ifp))
+ if (if_is_loopback(ifp))
return;
/* Check interface configuration. */
@@ -1462,7 +1462,7 @@ DEFUN (ipv6_nd_ra_fast_retrans,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct zebra_if *zif = ifp->info;
- if (if_is_loopback_or_vrf(ifp)) {
+ if (if_is_loopback(ifp)) {
vty_out(vty,
"Cannot configure IPv6 Router Advertisements on this interface\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1484,7 +1484,7 @@ DEFUN (no_ipv6_nd_ra_fast_retrans,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct zebra_if *zif = ifp->info;
- if (if_is_loopback_or_vrf(ifp)) {
+ if (if_is_loopback(ifp)) {
vty_out(vty,
"Cannot configure IPv6 Router Advertisements on this interface\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1506,7 +1506,7 @@ DEFPY (ipv6_nd_ra_hop_limit,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct zebra_if *zif = ifp->info;
- if (if_is_loopback_or_vrf(ifp)) {
+ if (if_is_loopback(ifp)) {
vty_out(vty,
"Cannot configure IPv6 Router Advertisements on this interface\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1529,7 +1529,7 @@ DEFPY (no_ipv6_nd_ra_hop_limit,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct zebra_if *zif = ifp->info;
- if (if_is_loopback_or_vrf(ifp)) {
+ if (if_is_loopback(ifp)) {
vty_out(vty,
"Cannot configure IPv6 Router Advertisements on this interface\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1551,7 +1551,7 @@ DEFPY (ipv6_nd_ra_retrans_interval,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct zebra_if *zif = ifp->info;
- if (if_is_loopback_or_vrf(ifp)) {
+ if (if_is_loopback(ifp)) {
vty_out(vty,
"Cannot configure IPv6 Router Advertisements on loopback interface\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1574,7 +1574,7 @@ DEFPY (no_ipv6_nd_ra_retrans_interval,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct zebra_if *zif = ifp->info;
- if (if_is_loopback_or_vrf(ifp)) {
+ if (if_is_loopback(ifp)) {
vty_out(vty,
"Cannot remove IPv6 Router Advertisements on loopback interface\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1595,7 +1595,7 @@ DEFUN (ipv6_nd_suppress_ra,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct zebra_if *zif = ifp->info;
- if (if_is_loopback_or_vrf(ifp)) {
+ if (if_is_loopback(ifp)) {
vty_out(vty,
"Cannot configure IPv6 Router Advertisements on this interface\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -1619,7 +1619,7 @@ DEFUN (no_ipv6_nd_suppress_ra,
VTY_DECLVAR_CONTEXT(interface, ifp);
struct zebra_if *zif = ifp->info;
- if (if_is_loopback_or_vrf(ifp)) {
+ if (if_is_loopback(ifp)) {
vty_out(vty,
"Cannot configure IPv6 Router Advertisements on this interface\n");
return CMD_WARNING_CONFIG_FAILED;
@@ -2608,7 +2608,7 @@ static int rtadv_config_write(struct vty *vty, struct interface *ifp)
zif = ifp->info;
- if (!if_is_loopback_or_vrf(ifp)) {
+ if (!if_is_loopback(ifp)) {
if (zif->rtadv.AdvSendAdvertisements
&& CHECK_FLAG(zif->rtadv.ra_configured, VTY_RA_CONFIGURED))
vty_out(vty, " no ipv6 nd suppress-ra\n");
diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c
index 42fa927d9..3df70a3b5 100644
--- a/zebra/zebra_rib.c
+++ b/zebra/zebra_rib.c
@@ -1026,7 +1026,7 @@ static struct route_entry *rib_choose_best(struct route_entry *current,
struct interface *ifp = if_lookup_by_index(
nexthop->ifindex, alternate->vrf_id);
- if (ifp && if_is_loopback_or_vrf(ifp))
+ if (ifp && if_is_loopback(ifp))
return alternate;
}
@@ -1034,7 +1034,7 @@ static struct route_entry *rib_choose_best(struct route_entry *current,
struct interface *ifp = if_lookup_by_index(
nexthop->ifindex, current->vrf_id);
- if (ifp && if_is_loopback_or_vrf(ifp))
+ if (ifp && if_is_loopback(ifp))
return current;
}