]> git.puffer.fish Git - mirror/frr.git/commitdiff
pimd, zebra: Encode nexthop vrf in message 3271/head
authorDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 1 Nov 2018 23:24:59 +0000 (19:24 -0400)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Thu, 1 Nov 2018 23:24:59 +0000 (19:24 -0400)
Encode the nexthop vrf in the message sent about mrib lookups.

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

index 6e703521043b823bd1d6c1eb5e143d024f04a8c8..0e74866117fe1c73b8930e0e8964ee262a60cc52 100644 (file)
@@ -202,10 +202,12 @@ static int zclient_read_nexthop(struct pim_instance *pim,
        }
 
        for (i = 0; i < nexthop_num; ++i) {
+               vrf_id_t nexthop_vrf_id;
                enum nexthop_types_t nexthop_type;
                struct pim_neighbor *nbr;
                struct prefix p;
 
+               nexthop_vrf_id = stream_getl(s);
                nexthop_type = stream_getc(s);
                if (num_ifindex >= tab_size) {
                        char addr_str[INET_ADDRSTRLEN];
@@ -219,6 +221,7 @@ static int zclient_read_nexthop(struct pim_instance *pim,
                }
                nexthop_tab[num_ifindex].protocol_distance = distance;
                nexthop_tab[num_ifindex].route_metric = metric;
+               nexthop_tab[num_ifindex].vrf_id = nexthop_vrf_id;
                switch (nexthop_type) {
                case NEXTHOP_TYPE_IFINDEX:
                        nexthop_tab[num_ifindex].ifindex = stream_getl(s);
@@ -265,12 +268,12 @@ static int zclient_read_nexthop(struct pim_instance *pim,
                                        if_lookup_by_index(
                                                nexthop_tab[num_ifindex]
                                                        .ifindex,
-                                               vrf_id),
+                                               nexthop_vrf_id),
                                        &p);
                        else
                                nbr = pim_neighbor_find_if(if_lookup_by_index(
                                        nexthop_tab[num_ifindex].ifindex,
-                                       vrf_id));
+                                       nexthop_vrf_id));
                        if (nbr) {
                                nexthop_tab[num_ifindex].nexthop_addr.family =
                                        AF_INET;
index f8a2d59f68ea125252fe4554b6814455dd08eea4..09e8dcd51f870b286d8604e2aae340a59995284a 100644 (file)
@@ -27,6 +27,7 @@
 #define PIM_NEXTHOP_LOOKUP_MAX (3) /* max. recursive route lookup */
 
 struct pim_zlookup_nexthop {
+       vrf_id_t vrf_id;
        struct prefix nexthop_addr;
        ifindex_t ifindex;
        uint32_t route_metric;
index 42b0a815104e09802d3a992066432f9acce08efd..83b4ffa832f47a8aa814dfcabcd7eae0284c3583 100644 (file)
@@ -118,6 +118,7 @@ static void zserv_encode_vrf(struct stream *s, struct zebra_vrf *zvrf)
 
 static int zserv_encode_nexthop(struct stream *s, struct nexthop *nexthop)
 {
+       stream_putl(s, nexthop->vrf_id);
        stream_putc(s, nexthop->type);
        switch (nexthop->type) {
        case NEXTHOP_TYPE_IPV4: