]> git.proxmox.com Git - mirror_frr.git/blobdiff - pbrd/pbr_zebra.c
zebra: Convert socket interface to use `union sockunion`
[mirror_frr.git] / pbrd / pbr_zebra.c
index 8d336c9d0d95b3b98984e93caaf62a910cc56027..7974bbfb4e60d3ae6a22423ed089e170c7c6803b 100644 (file)
@@ -54,12 +54,6 @@ struct pbr_interface *pbr_if_new(struct interface *ifp)
 
        pbr_ifp = XCALLOC(MTYPE_PBR_INTERFACE, sizeof(*pbr_ifp));
 
-       if (!pbr_ifp) {
-               zlog_err("%s: PBR XCALLOC(%zu) failure", __PRETTY_FUNCTION__,
-                        sizeof(*pbr_ifp));
-               return 0;
-       }
-
        ifp->info = pbr_ifp;
        return pbr_ifp;
 }
@@ -213,13 +207,13 @@ static int rule_notify_owner(int command, struct zclient *zclient,
 
        switch (note) {
        case ZAPI_RULE_FAIL_INSTALL:
-               DEBUGD(&pbr_dbg_zebra, "%s: Recieved RULE_FAIL_INSTALL",
+               DEBUGD(&pbr_dbg_zebra, "%s: Received RULE_FAIL_INSTALL",
                       __PRETTY_FUNCTION__);
                pbrms->installed &= ~installed;
                break;
        case ZAPI_RULE_INSTALLED:
                pbrms->installed |= installed;
-               DEBUGD(&pbr_dbg_zebra, "%s: Recived RULE_INSTALLED",
+               DEBUGD(&pbr_dbg_zebra, "%s: Received RULE_INSTALLED",
                       __PRETTY_FUNCTION__);
                break;
        case ZAPI_RULE_FAIL_REMOVE:
@@ -367,7 +361,10 @@ static int pbr_zebra_nexthop_update(int command, struct zclient *zclient,
        char buf[PREFIX2STR_BUFFER];
        uint32_t i;
 
-       zapi_nexthop_update_decode(zclient->ibuf, &nhr);
+       if (!zapi_nexthop_update_decode(zclient->ibuf, &nhr)) {
+               zlog_warn("Failure to decode Nexthop update message");
+               return 0;
+       }
 
        if (DEBUG_MODE_CHECK(&pbr_dbg_zebra, DEBUG_MODE_ALL)) {
 
@@ -397,7 +394,7 @@ void pbr_zebra_init(void)
 {
        struct zclient_options opt = { .receive_notify = true };
 
-       zclient = zclient_new_notify(master, &opt);
+       zclient = zclient_new(master, &opt);
 
        zclient_init(zclient, ZEBRA_ROUTE_PBR, 0, &pbr_privs);
        zclient->zebra_connected = zebra_connected;