* 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. */
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 {
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) {
}
/* 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?
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;
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);
{
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;
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);
/* 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);
/* 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);
}
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);
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))
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;
{
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;
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));
{
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)) {
/*
* No need to ever start loopback or vrf device hello's
*/
- if (if_is_loopback_or_vrf(ifp))
+ if (if_is_loopback(ifp))
return;
/*
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 &&
{
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,
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
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;
VRF_LOGNAME(vrf), ifp->ifindex, len, addr_str);
}
- if (if_is_loopback_or_vrf(ifp))
+ if (if_is_loopback(ifp))
return;
/* Check interface configuration. */
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;
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;
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;
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;
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;
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;
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;
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;
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");
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;
}
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;
}