]> git.puffer.fish Git - matthieu/frr.git/commitdiff
zebra: Remove zclient->idinfo restrictions
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 4 Feb 2019 16:45:31 +0000 (11:45 -0500)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Tue, 5 Feb 2019 14:13:30 +0000 (09:13 -0500)
The restricting of data about interfaces was both inconsistent
in application and allowed protocol developers to get into states where
they did not have the expected data about an interface that they
thought that they would.  These restrictions and inconsistencies
keep causing bugs that have to be sorted through.

The latest iteration of this bug was that commit:
f20b478ef3d25e153939516a473bb2e80603cbd5

Has caused pim to not receive interface up notifications( but
it knows the interface is back in the vrf and it knows the
relevant ip addresses on the interface as they were changed
as part of an ifdown/ifup cycle ).

Remove this restriction and allow the interface events to
be propagated to all clients.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
zebra/redistribute.c
zebra/zapi_msg.c
zebra/zebra_ptm_redistribute.c
zebra/zserv.c
zebra/zserv.h

index 9c3002e775e81b5e5c9f9f1949b12a3d98524647..f98a4c02c320d8779e89cfb66199b87fdcd3efdd 100644 (file)
@@ -406,12 +406,11 @@ void zebra_interface_up_update(struct interface *ifp)
 
        if (ifp->ptm_status || !ifp->ptm_enable) {
                for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode,
-                                      client))
-                       if (vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) {
-                               zsend_interface_update(ZEBRA_INTERFACE_UP,
-                                                      client, ifp);
-                               zsend_interface_link_params(client, ifp);
-                       }
+                                      client)) {
+                       zsend_interface_update(ZEBRA_INTERFACE_UP,
+                                              client, ifp);
+                       zsend_interface_link_params(client, ifp);
+               }
        }
 }
 
@@ -440,12 +439,11 @@ void zebra_interface_add_update(struct interface *ifp)
                zlog_debug("MESSAGE: ZEBRA_INTERFACE_ADD %s(%u)", ifp->name,
                           ifp->vrf_id);
 
-       for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
-               if (vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) {
-                       client->ifadd_cnt++;
-                       zsend_interface_add(client, ifp);
-                       zsend_interface_link_params(client, ifp);
-               }
+       for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) {
+               client->ifadd_cnt++;
+               zsend_interface_add(client, ifp);
+               zsend_interface_link_params(client, ifp);
+       }
 }
 
 void zebra_interface_delete_update(struct interface *ifp)
@@ -814,6 +812,5 @@ void zebra_interface_parameters_update(struct interface *ifp)
                           ifp->name, ifp->vrf_id);
 
        for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client))
-               if (vrf_bitmap_check(client->ifinfo, ifp->vrf_id))
-                       zsend_interface_link_params(client, ifp);
+               zsend_interface_link_params(client, ifp);
 }
index 611d859aaa1cbc8429e1c477c6c9d0132f31b612..3bf03039b1227a8a0aa9b1b05a1ac2a34c8eaf01 100644 (file)
@@ -209,12 +209,6 @@ int zsend_interface_link_params(struct zserv *client, struct interface *ifp)
 {
        struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ);
 
-       /* Check this client need interface information. */
-       if (!vrf_bitmap_check(client->ifinfo, ifp->vrf_id)) {
-               stream_free(s);
-               return 0;
-       }
-
        if (!ifp->link_params) {
                stream_free(s);
                return 0;
@@ -1317,9 +1311,6 @@ static void zread_interface_add(ZAPI_HANDLER_ARGS)
        struct vrf *vrf;
        struct interface *ifp;
 
-       /* Interface information is needed. */
-       vrf_bitmap_set(client->ifinfo, zvrf_id(zvrf));
-
        RB_FOREACH (vrf, vrf_id_head, &vrfs_by_id) {
                FOR_ALL_INTERFACES (vrf, ifp) {
                        /* Skip pseudo interface. */
@@ -1336,7 +1327,6 @@ static void zread_interface_add(ZAPI_HANDLER_ARGS)
 /* Unregister zebra server interface information. */
 static void zread_interface_delete(ZAPI_HANDLER_ARGS)
 {
-       vrf_bitmap_unset(client->ifinfo, zvrf_id(zvrf));
 }
 
 void zserv_nexthop_num_warn(const char *caller, const struct prefix *p,
@@ -1731,7 +1721,6 @@ static void zread_vrf_unregister(ZAPI_HANDLER_ARGS)
                        vrf_bitmap_unset(client->redist[afi][i], zvrf_id(zvrf));
                vrf_bitmap_unset(client->redist_default[afi], zvrf_id(zvrf));
        }
-       vrf_bitmap_unset(client->ifinfo, zvrf_id(zvrf));
        vrf_bitmap_unset(client->ridinfo, zvrf_id(zvrf));
 }
 
index 0c24c732a44b54446f2c78da35ca1cddbcd1e75b..01d5114b9fbf7b21d4fb75d08dffbaed25a59724 100644 (file)
@@ -36,10 +36,6 @@ static int zsend_interface_bfd_update(int cmd, struct zserv *client,
        int blen;
        struct stream *s;
 
-       /* Check this client need interface information. */
-       if (!vrf_bitmap_check(client->ifinfo, ifp->vrf_id))
-               return 0;
-
        s = stream_new(ZEBRA_MAX_PACKET_SIZ);
 
        zclient_create_header(s, cmd, vrf_id);
index e4fc348b1af79c90c2624cd569e1a61fc3511417..ad052d6a70486e08a0818f16206856c9ae3527be 100644 (file)
@@ -626,7 +626,6 @@ static void zserv_client_free(struct zserv *client)
 
                vrf_bitmap_free(client->redist_default[afi]);
        }
-       vrf_bitmap_free(client->ifinfo);
        vrf_bitmap_free(client->ridinfo);
 
        XFREE(MTYPE_TMP, client);
@@ -710,7 +709,6 @@ static struct zserv *zserv_client_create(int sock)
                        client->redist[afi][i] = vrf_bitmap_init();
                client->redist_default[afi] = vrf_bitmap_init();
        }
-       client->ifinfo = vrf_bitmap_init();
        client->ridinfo = vrf_bitmap_init();
 
        /* by default, it's not a synchronous client */
index f7c4e3df73d2e7689f5edee195be5e861b8b0a46..ac016e65f3e19563b394fd6723e0bd46cafe0c59 100644 (file)
@@ -89,9 +89,6 @@ struct zserv {
        /* Redistribute default route flag. */
        vrf_bitmap_t redist_default[AFI_MAX];
 
-       /* Interface information. */
-       vrf_bitmap_t ifinfo;
-
        /* Router-id information. */
        vrf_bitmap_t ridinfo;