]> git.proxmox.com Git - mirror_frr.git/commitdiff
zebra: Add the afi_t to the rnh
authorDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 6 Feb 2019 15:53:48 +0000 (10:53 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Wed, 27 Mar 2019 20:19:28 +0000 (16:19 -0400)
Store the associated afi with the rnh, it will be useful in the future.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/zebra_rnh.c
zebra/zebra_rnh.h

index fcb6585b3546e28cf6be71e8cde9f4c66d659ab1..e64e64c974893bc39c52c3feb5b6c6e3db2122de 100644 (file)
@@ -101,12 +101,13 @@ struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, rnh_type_t type,
        struct route_node *rn;
        struct rnh *rnh = NULL;
        char buf[PREFIX2STR_BUFFER];
+       afi_t afi = family2afi(p->family);
 
        if (IS_ZEBRA_DEBUG_NHT) {
                prefix2str(p, buf, sizeof(buf));
                zlog_debug("%u: Add RNH %s type %d", vrfid, buf, type);
        }
-       table = get_rnh_table(vrfid, family2afi(PREFIX_FAMILY(p)), type);
+       table = get_rnh_table(vrfid, afi, type);
        if (!table) {
                prefix2str(p, buf, sizeof(buf));
                flog_warn(EC_ZEBRA_RNH_NO_TABLE,
@@ -127,6 +128,7 @@ struct rnh *zebra_add_rnh(struct prefix *p, vrf_id_t vrfid, rnh_type_t type,
                rnh->client_list = list_new();
                rnh->vrf_id = vrfid;
                rnh->type = type;
+               rnh->afi = afi;
                rnh->zebra_pseudowire_list = list_new();
                route_lock_node(rn);
                rn->info = rnh;
index 574dcb27bed7546295ccef401f926666f278609d..38c95877ed9c85ce252b98d940ff78913a0540f4 100644 (file)
@@ -42,6 +42,8 @@ struct rnh {
        /* VRF identifier. */
        vrf_id_t vrf_id;
 
+       afi_t afi;
+
        rnh_type_t type;
 
        struct route_entry *state;