diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index b0eb85e5f8..0e5f701fc2 100644 --- a/bfdd/ptm_adapter.c +++ b/bfdd/ptm_adapter.c @@ -457,7 +457,7 @@ static int _ptm_msg_read(struct stream *msg, int command, vrf_id_t vrf_id, } /* Sanity check: peer and local address must match IP types. */ - if (bpc->bpc_local.sa_sin.sin_family != 0 + if (bpc->bpc_local.sa_sin.sin_family != AF_UNSPEC && (bpc->bpc_local.sa_sin.sin_family != bpc->bpc_peer.sa_sin.sin_family)) { zlog_warn("ptm-read: peer family doesn't match local type"); diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index 07aed045ca..4b50b46569 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -388,7 +388,7 @@ int rfapiGetVncTunnelUnAddr(struct attr *attr, struct prefix *p) return 0; /* MPLS carries UN address in next hop */ rfapiNexthop2Prefix(attr, p); - if (p->family != 0) + if (p->family != AF_UNSPEC) return 0; return ENOENT; @@ -457,7 +457,7 @@ int rfapiGetUnAddrOfVpnBi(struct bgp_path_info *bpi, struct prefix *p) return 0; default: if (p) - p->family = 0; + p->family = AF_UNSPEC; #ifdef DEBUG_ENCAP_MONITOR vnc_zlog_debug_verbose( "%s: bpi->extra->vnc.import.un_family is 0, no UN addr", @@ -1155,7 +1155,7 @@ static int rfapiVpnBiSamePtUn(struct bgp_path_info *bpi1, bpi1->extra->vnc.import.un.addr6; break; default: - pfx_un1.family = 0; + pfx_un1.family = AF_UNSPEC; break; } } @@ -1174,13 +1174,13 @@ static int rfapiVpnBiSamePtUn(struct bgp_path_info *bpi1, bpi2->extra->vnc.import.un.addr6; break; default: - pfx_un2.family = 0; + pfx_un2.family = AF_UNSPEC; break; } } } - if (pfx_un1.family == 0 || pfx_un2.family == 0) + if (pfx_un1.family == AF_UNSPEC || pfx_un2.family == AF_UNSPEC) return 0; if (pfx_un1.family != pfx_un2.family) @@ -1358,7 +1358,7 @@ rfapiRouteInfo2NextHopEntry(struct rfapi_ip_prefix *rprefix, struct prefix p; /* MPLS carries UN address in next hop */ rfapiNexthop2Prefix(bpi->attr, &p); - if (p.family != 0) { + if (p.family != AF_UNSPEC) { rfapiQprefix2Raddr(&p, &new->un_address); have_vnc_tunnel_un = 1; } @@ -2609,7 +2609,7 @@ static void rfapiCopyUnEncap2VPN(struct bgp_path_info *encap_bpi, default: zlog_warn("%s: invalid encap nexthop length: %d", __func__, encap_bpi->attr->mp_nexthop_len); - vpn_bpi->extra->vnc.import.un_family = 0; + vpn_bpi->extra->vnc.import.un_family = AF_UNSPEC; break; } } @@ -2634,7 +2634,7 @@ rfapiWithdrawEncapUpdateCachedUn(struct rfapi_import_table *import_table, __func__); return 1; } - vpn_bpi->extra->vnc.import.un_family = 0; + vpn_bpi->extra->vnc.import.un_family = AF_UNSPEC; memset(&vpn_bpi->extra->vnc.import.un, 0, sizeof(vpn_bpi->extra->vnc.import.un)); if (CHECK_FLAG(vpn_bpi->flags, BGP_PATH_VALID)) { @@ -3626,7 +3626,7 @@ void rfapiBgpInfoFilteredImportVPN( /* Not a big deal, just means VPN route got here first */ vnc_zlog_debug_verbose("%s: no encap route for vn addr %pFX", __func__, &vn_prefix); - info_new->extra->vnc.import.un_family = 0; + info_new->extra->vnc.import.un_family = AF_UNSPEC; } if (rn) { diff --git a/bgpd/rfapi/rfapi_rib.c b/bgpd/rfapi/rfapi_rib.c index d1f335f549..6b9a8fb4a7 100644 --- a/bgpd/rfapi/rfapi_rib.c +++ b/bgpd/rfapi/rfapi_rib.c @@ -1950,7 +1950,7 @@ rfapiRibPreload(struct bgp *bgp, struct rfapi_descriptor *rfd, && RFAPI_HOST_PREFIX(&rk.aux_prefix)) { /* mark as "none" if nhp->prefix is 0/32 or * 0/128 */ - rk.aux_prefix.family = 0; + rk.aux_prefix.family = AF_UNSPEC; } } diff --git a/lib/filter_nb.c b/lib/filter_nb.c index 80ea7a57cb..35b97a9bde 100644 --- a/lib/filter_nb.c +++ b/lib/filter_nb.c @@ -1135,7 +1135,7 @@ static int lib_access_list_entry_any_destroy(struct nb_cb_destroy_args *args) f = nb_running_get_entry(args->dnode, NULL, true); fz = &f->u.zfilter; - fz->prefix.family = 0; + fz->prefix.family = AF_UNSPEC; acl_notify_route_map(f->acl, RMAP_EVENT_FILTER_DELETED); diff --git a/ospfd/ospf_lsa.c b/ospfd/ospf_lsa.c index c169996e01..aae57a2d0b 100644 --- a/ospfd/ospf_lsa.c +++ b/ospfd/ospf_lsa.c @@ -2983,7 +2983,7 @@ void ospf_lsa_maxage_delete(struct ospf *ospf, struct ospf_lsa *lsa) struct prefix lsa_prefix; memset(&lsa_prefix, 0, sizeof(struct prefix)); - lsa_prefix.family = 0; + lsa_prefix.family = AF_UNSPEC; lsa_prefix.prefixlen = sizeof(lsa_prefix.u.ptr) * CHAR_BIT; lsa_prefix.u.ptr = (uintptr_t)lsa; @@ -3024,7 +3024,7 @@ void ospf_lsa_maxage(struct ospf *ospf, struct ospf_lsa *lsa) } memset(&lsa_prefix, 0, sizeof(struct prefix)); - lsa_prefix.family = 0; + lsa_prefix.family = AF_UNSPEC; lsa_prefix.prefixlen = sizeof(lsa_prefix.u.ptr) * CHAR_BIT; lsa_prefix.u.ptr = (uintptr_t)lsa; diff --git a/ospfd/ospf_lsdb.c b/ospfd/ospf_lsdb.c index 86eb141312..b0881c098f 100644 --- a/ospfd/ospf_lsdb.c +++ b/ospfd/ospf_lsdb.c @@ -70,7 +70,7 @@ void ospf_lsdb_cleanup(struct ospf_lsdb *lsdb) void ls_prefix_set(struct prefix_ls *lp, struct ospf_lsa *lsa) { if (lp && lsa && lsa->data) { - lp->family = 0; + lp->family = AF_UNSPEC; lp->prefixlen = 64; lp->id = lsa->data->id; lp->adv_router = lsa->data->adv_router; @@ -199,7 +199,7 @@ struct ospf_lsa *ospf_lsdb_lookup_by_id(struct ospf_lsdb *lsdb, uint8_t type, table = lsdb->type[type].db; memset(&lp, 0, sizeof(struct prefix_ls)); - lp.family = 0; + lp.family = AF_UNSPEC; lp.prefixlen = 64; lp.id = id; lp.adv_router = adv_router; @@ -226,7 +226,7 @@ struct ospf_lsa *ospf_lsdb_lookup_by_id_next(struct ospf_lsdb *lsdb, table = lsdb->type[type].db; memset(&lp, 0, sizeof(struct prefix_ls)); - lp.family = 0; + lp.family = AF_UNSPEC; lp.prefixlen = 64; lp.id = id; lp.adv_router = adv_router; diff --git a/ospfd/ospf_snmp.c b/ospfd/ospf_snmp.c index 7ec3db7894..bf37556863 100644 --- a/ospfd/ospf_snmp.c +++ b/ospfd/ospf_snmp.c @@ -1779,7 +1779,7 @@ static int ospf_snmp_vl_add(struct ospf_vl_data *vl_data) struct route_node *rn; memset(&lp, 0, sizeof(struct prefix_ls)); - lp.family = 0; + lp.family = AF_UNSPEC; lp.prefixlen = 64; lp.id = vl_data->vl_area_id; lp.adv_router = vl_data->vl_peer; @@ -1798,7 +1798,7 @@ static int ospf_snmp_vl_delete(struct ospf_vl_data *vl_data) struct route_node *rn; memset(&lp, 0, sizeof(struct prefix_ls)); - lp.family = 0; + lp.family = AF_UNSPEC; lp.prefixlen = 64; lp.id = vl_data->vl_area_id; lp.adv_router = vl_data->vl_peer; @@ -1820,7 +1820,7 @@ static struct ospf_vl_data *ospf_snmp_vl_lookup(struct in_addr *area_id, struct ospf_vl_data *vl_data; memset(&lp, 0, sizeof(struct prefix_ls)); - lp.family = 0; + lp.family = AF_UNSPEC; lp.prefixlen = 64; lp.id = *area_id; lp.adv_router = *neighbor; @@ -1843,7 +1843,7 @@ static struct ospf_vl_data *ospf_snmp_vl_lookup_next(struct in_addr *area_id, struct ospf_vl_data *vl_data; memset(&lp, 0, sizeof(struct prefix_ls)); - lp.family = 0; + lp.family = AF_UNSPEC; lp.prefixlen = 64; lp.id = *area_id; lp.adv_router = *neighbor; diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index c82c8cb42e..e113c4265d 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -6578,7 +6578,7 @@ static void show_lsa_prefix_set(struct vty *vty, struct prefix_ls *lp, struct in_addr *id, struct in_addr *adv_router) { memset(lp, 0, sizeof(struct prefix_ls)); - lp->family = 0; + lp->family = AF_UNSPEC; if (id == NULL) lp->prefixlen = 0; else if (adv_router == NULL) { diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index fac312cf7c..c1b104aec7 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -2369,7 +2369,7 @@ static unsigned nexthop_active_check(struct route_node *rn, else if (rn->p.family == AF_INET6) family = AFI_IP6; else - family = 0; + family = AF_UNSPEC; if (IS_ZEBRA_DEBUG_NHG_DETAIL) zlog_debug("%s: re %p, nexthop %pNHv", __func__, re, nexthop);