if (pi->attr)
nh = pi->attr->nexthop;
else
- nh.s_addr = 0;
+ nh.s_addr = INADDR_ANY;
if (install && !bgp_evpn_es_is_vtep_active(esi, nh)) {
if (BGP_DEBUG(evpn_mh, EVPN_MH_RT)) {
char esi_buf[ESI_STR_LEN];
/* EAD route prefix doesn't include the nexthop in the global
* table
*/
- vtep_ip.s_addr = 0;
+ vtep_ip.s_addr = INADDR_ANY;
build_evpn_type1_prefix(&p, eth_tag, &esi, vtep_ip);
/* Process the route. */
if (attr) {
{
memcpy(global_p, vni_p, sizeof(*global_p));
global_p->prefix.ead_addr.ip.ipa_type = 0;
- global_p->prefix.ead_addr.ip.ipaddr_v4.s_addr = 0;
+ global_p->prefix.ead_addr.ip.ipaddr_v4.s_addr = INADDR_ANY;
}
/* EAD prefix in the global table doesn't include the VTEP-IP so
char local_buff[INET6_ADDRSTRLEN];
local_buff[0] = '\0';
- if (p->u.prefix_flowspec.family == AF_INET &&
- attr->nexthop.s_addr != 0)
+ if (p->u.prefix_flowspec.family == AF_INET
+ && attr->nexthop.s_addr != INADDR_ANY)
inet_ntop(AF_INET,
&attr->nexthop.s_addr,
local_buff,
bgp = nb_running_get_entry(args->dnode, NULL, true);
- router_id.s_addr = 0;
+ router_id.s_addr = INADDR_ANY;
bgp_router_id_static_set(bgp, router_id);
return NB_OK;
}
if (IN6_IS_ADDR_UNSPECIFIED(mod_v6nhg)) {
- if (peer->nexthop.v4.s_addr) {
+ if (peer->nexthop.v4.s_addr != INADDR_ANY) {
ipv4_to_ipv4_mapped_ipv6(mod_v6nhg,
peer->nexthop.v4);
}
vty_out(vty, " no bgp fast-external-failover\n");
/* BGP router ID. */
- if (bgp->router_id_static.s_addr != 0)
+ if (bgp->router_id_static.s_addr != INADDR_ANY)
vty_out(vty, " bgp router-id %pI4\n",
&bgp->router_id_static);
#define RFAPI_0_PREFIX(prefix) \
((((prefix)->family == AF_INET) \
- ? (prefix)->u.prefix4.s_addr == 0 \
+ ? (prefix)->u.prefix4.s_addr == INADDR_ANY \
: (((prefix)->family == AF_INET6) \
? (IN6_IS_ADDR_UNSPECIFIED(&(prefix)->u.prefix6)) \
: 0)))
continue;
/* EIGRP must be on and Router-ID must be configured. */
- if (eigrp->router_id.s_addr == 0)
+ if (eigrp->router_id.s_addr == INADDR_ANY)
continue;
/* Run each network for this interface. */
*/
if (area->newmetric) {
if (IS_MPLS_TE(area->mta)
- && area->mta->router_id.s_addr != 0)
+ && area->mta->router_id.s_addr != INADDR_ANY)
id.s_addr = area->mta->router_id.s_addr;
lsp_debug(
"ISIS (%s): Adding router ID also as TE router ID tlv.",
struct ospf_path *op;
for (ALL_LIST_ELEMENTS_RO(ro->paths, node, op))
- if (op->nexthop.s_addr == 0)
+ if (op->nexthop.s_addr == INADDR_ANY)
op->nexthop.s_addr = nexthop.s_addr;
}
return NULL;
}
- if (al->e[0].fwd_addr.s_addr != 0)
+ if (al->e[0].fwd_addr.s_addr != INADDR_ANY)
{
if (IS_DEBUG_OSPF (lsa, LSA))
zlog_debug ("ospf_ase_calculate(): Forwarding address is not 0.0.0.0.");
if (oi->area->external_routing == OSPF_AREA_NSSA)
if (oi->address
&& oi->address->family == AF_INET) {
- if (best_default.s_addr == 0)
+ if (best_default.s_addr == INADDR_ANY)
best_default =
oi->address->u.prefix4;
if (oi->area == area)
return oi->address->u.prefix4;
}
}
- if (best_default.s_addr != 0)
+ if (best_default.s_addr != INADDR_ANY)
return best_default;
- if (best_default.s_addr != 0)
+ if (best_default.s_addr != INADDR_ANY)
return best_default;
return fwd;
/* kevinm: not updating lsa anymore, just new */
extlsa = (struct as_external_lsa *)(new->data);
- if (extlsa->e[0].fwd_addr.s_addr == 0)
+ if (extlsa->e[0].fwd_addr.s_addr == INADDR_ANY)
extlsa->e[0].fwd_addr = ospf_get_nssa_ip(
area); /* this NSSA area in ifp */
- if (extlsa->e[0].fwd_addr.s_addr == 0) {
+ if (extlsa->e[0].fwd_addr.s_addr == INADDR_ANY) {
if (IS_DEBUG_OSPF_NSSA)
zlog_debug(
"LSA[Type-7]: Could not build FWD-ADDR");
or->cost);
for (ALL_LIST_ELEMENTS_RO(or->paths, pnode,
path))
- if (path->nexthop.s_addr != 0)
+ if (path->nexthop.s_addr != INADDR_ANY)
vty_out(vty, " -> %pI4\n",
&path->nexthop);
else
} else {
/* Unnumbered interfaces --> Sort them based on
* interface indexes */
- if (osif->addr.s_addr != 0 || osif->ifindex > ifindex)
+ if (osif->addr.s_addr != INADDR_ANY
+ || osif->ifindex > ifindex)
break;
}
pn = node;
for (ALL_LIST_ELEMENTS(ospf->oiflist, node, nnode, oi)) {
for (rn = route_top(oi->nbrs); rn; rn = route_next(rn))
- if ((nbr = rn->info) != NULL && nbr != oi->nbr_self
+ if ((nbr = rn->info) != NULL
+ && nbr != oi->nbr_self
/* If EXACT match is needed, provide ALL entry found
&& nbr->state != NSM_Down
*/
- && nbr->src.s_addr != 0) {
+ && nbr->src.s_addr != INADDR_ANY) {
if (IPV4_ADDR_SAME(&nbr->src, nbr_addr)) {
route_unlock_node(rn);
return nbr;
for (ALL_LIST_ELEMENTS_RO(ospf->oiflist, nn, oi)) {
for (rn = route_top(oi->nbrs); rn; rn = route_next(rn))
if ((nbr = rn->info) != NULL && nbr != oi->nbr_self
- && nbr->state != NSM_Down && nbr->src.s_addr != 0) {
+ && nbr->state != NSM_Down
+ && nbr->src.s_addr != INADDR_ANY) {
if (first) {
if (!min)
min = nbr;
for (ALL_LIST_ELEMENTS_RO (or->paths, pnode, path))
{
- if (path->nexthop.s_addr == 0)
+ if (path->nexthop.s_addr == INADDR_ANY)
{
if (IS_DEBUG_OSPF_EVENT)
zlog_debug (" directly attached to %s\r",
if (if_lookup_by_index(path->ifindex,
ospf->vrf_id)) {
- if (path->nexthop.s_addr == 0) {
+ if (path->nexthop.s_addr
+ == INADDR_ANY) {
if (json) {
json_object_string_add(
json_nexthop,
}
if (if_lookup_by_index(path->ifindex,
ospf->vrf_id)) {
- if (path->nexthop.s_addr == 0) {
+ if (path->nexthop.s_addr
+ == INADDR_ANY) {
if (json) {
json_object_string_add(
json_nexthop,
}
if (if_lookup_by_index(path->ifindex, ospf->vrf_id)) {
- if (path->nexthop.s_addr == 0) {
+ if (path->nexthop.s_addr == INADDR_ANY) {
if (json) {
json_object_string_add(
json_nexthop, "ip",
}
/* Router ID print. */
- if (ospf->router_id_static.s_addr != 0)
+ if (ospf->router_id_static.s_addr != INADDR_ANY)
vty_out(vty, " ospf router-id %pI4\n",
&ospf->router_id_static);
disruptive.
3. Last choice: just go with whatever the zebra daemon recommends.
*/
- if (ospf->router_id_static.s_addr != 0)
+ if (ospf->router_id_static.s_addr != INADDR_ANY)
router_id = ospf->router_id_static;
- else if (ospf->router_id.s_addr != 0)
+ else if (ospf->router_id.s_addr != INADDR_ANY)
router_id = ospf->router_id;
else
router_id = ospf->router_id_zebra;
return CMD_WARNING;
}
- if (s_or_g.s_addr != 0) {
- if (g.s_addr != 0) {
+ if (s_or_g.s_addr != INADDR_ANY) {
+ if (g.s_addr != INADDR_ANY) {
sg.src = s_or_g;
sg.grp = g;
} else
return CMD_WARNING;
}
- if (s_or_g.s_addr != 0) {
- if (g.s_addr != 0) {
+ if (s_or_g.s_addr != INADDR_ANY) {
+ if (g.s_addr != INADDR_ANY) {
sg.src = s_or_g;
sg.grp = g;
} else
if (!c_oil->installed)
continue;
- if (sg->grp.s_addr != 0 &&
- sg->grp.s_addr != c_oil->oil.mfcc_mcastgrp.s_addr)
+ if (sg->grp.s_addr != INADDR_ANY
+ && sg->grp.s_addr != c_oil->oil.mfcc_mcastgrp.s_addr)
continue;
- if (sg->src.s_addr != 0 &&
- sg->src.s_addr != c_oil->oil.mfcc_origin.s_addr)
+ if (sg->src.s_addr != INADDR_ANY
+ && sg->src.s_addr != c_oil->oil.mfcc_origin.s_addr)
continue;
pim_inet4_dump("<group?>", c_oil->oil.mfcc_mcastgrp, grp_str,
return CMD_WARNING;
}
- if (s_or_g.s_addr != 0) {
- if (g.s_addr != 0) {
+ if (s_or_g.s_addr != INADDR_ANY) {
+ if (g.s_addr != INADDR_ANY) {
sg.src = s_or_g;
sg.grp = g;
} else
continue;
for (nh_node = pnc.nexthop; nh_node; nh_node = nh_node->next) {
- if (nh_node->gate.ipv4.s_addr != 0)
+ if (nh_node->gate.ipv4.s_addr != INADDR_ANY)
continue;
struct interface *ifp1 = if_lookup_by_index(
struct interface *oifp =
pim_if_find_by_vif_index(pim,
i);
- if (sroute->source.s_addr == 0)
+ if (sroute->source.s_addr == INADDR_ANY)
vty_out(vty,
" ip mroute %s %s\n",
oifp->name, gbuf);
*/
static inline bool pim_vxlan_is_orig_mroute(struct pim_vxlan_sg *vxlan_sg)
{
- return (vxlan_sg->sg.src.s_addr != 0);
+ return (vxlan_sg->sg.src.s_addr != INADDR_ANY);
}
static inline bool pim_vxlan_is_local_sip(struct pim_upstream *up)
rte->metric = RIP_METRIC_INFINITY;
/* Set nexthop pointer. */
- if (rte->nexthop.s_addr == 0)
+ if (rte->nexthop.s_addr == INADDR_ANY)
nexthop = &from->sin_addr;
else
nexthop = &rte->nexthop;
/* Only routes directly connected to an interface
* (nexthop == 0)
* may have a valid NULL distance */
- if (rinfo->nh.gate.ipv4.s_addr != 0)
+ if (rinfo->nh.gate.ipv4.s_addr != INADDR_ANY)
old_dist = old_dist
? old_dist
: ZEBRA_RIP_DISTANCE_DEFAULT;
memcpy(&classfull, &rp->p,
sizeof(struct prefix_ipv4));
apply_classful_mask_ipv4(&classfull);
- if (rp->p.u.prefix4.s_addr != 0
+ if (rp->p.u.prefix4.s_addr != INADDR_ANY
&& classfull.prefixlen
!= rp->p.prefixlen)
continue;
memset(&sg.r.backup_nhop, 0, sizeof(sg.r.nhop));
memset(&sg.r.backup_nhop_group, 0, sizeof(sg.r.nhop_group));
- if (start4.s_addr != 0) {
+ if (start4.s_addr != INADDR_ANY) {
prefix.family = AF_INET;
prefix.prefixlen = 32;
prefix.u.prefix4 = start4;
memset(&prefix, 0, sizeof(prefix));
- if (start4.s_addr != 0) {
+ if (start4.s_addr != INADDR_ANY) {
prefix.family = AF_INET;
prefix.prefixlen = 32;
prefix.u.prefix4 = start4;
memset(&prefix, 0, sizeof(prefix));
- if (dst4.s_addr != 0) {
+ if (dst4.s_addr != INADDR_ANY) {
prefix.family = AF_INET;
prefix.prefixlen = 32;
prefix.u.prefix4 = dst4;
inet_ntop(AF_INET6, &zvrf->rid6_user_assigned.u.prefix6,
addr_name, sizeof(addr_name));
} else {
- if (zvrf->rid_user_assigned.u.prefix4.s_addr == 0)
+ if (zvrf->rid_user_assigned.u.prefix4.s_addr
+ == INADDR_ANY)
return CMD_SUCCESS;
inet_ntop(AF_INET, &zvrf->rid_user_assigned.u.prefix4,
addr_name, sizeof(addr_name));