]> git.puffer.fish Git - matthieu/frr.git/commitdiff
ospfd: Use AF_UNSPEC instead of setting to 0
authorDonald Sharp <sharpd@nvidia.com>
Mon, 7 Feb 2022 18:20:43 +0000 (13:20 -0500)
committerDonald Sharp <sharpd@nvidia.com>
Mon, 7 Feb 2022 18:20:43 +0000 (13:20 -0500)
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
ospfd/ospf_lsa.c
ospfd/ospf_lsdb.c
ospfd/ospf_snmp.c
ospfd/ospf_vty.c

index c169996e013384eb34e05f0506871a1f2d56889d..aae57a2d0b9f1bb76edf0e83475d46565418cbee 100644 (file)
@@ -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;
 
index 86eb141312ebb72464a6f96c7d659e234b4445e5..b0881c098f568919b3f47a00468a663aa024b927 100644 (file)
@@ -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;
index 7ec3db7894634237c4120947f036c21b9157ffaa..bf375568633ae756fa3fc1066f745c16bd7df345 100644 (file)
@@ -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;
index c82c8cb42ec3f059d1d4273545acfeed0c8797ee..e113c4265d26fe769d3aedd877ef3100ae3d67d6 100644 (file)
@@ -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) {