]> git.proxmox.com Git - mirror_frr.git/blobdiff - pbrd/pbr_zebra.c
Merge pull request #2992 from opensourcerouting/large_as_path_fix
[mirror_frr.git] / pbrd / pbr_zebra.c
index 4e5b5f3dde90d1142a59935b77251190063f53b8..25d64238bfd3b6ced06a290e6795e8bad96d93db 100644 (file)
@@ -54,13 +54,8 @@ 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;
-       }
-
-       return (pbr_ifp);
+       ifp->info = pbr_ifp;
+       return pbr_ifp;
 }
 
 /* Inteface addition message from zebra. */
@@ -74,12 +69,8 @@ static int interface_add(int command, struct zclient *zclient,
        if (!ifp)
                return 0;
 
-       if (!ifp->info) {
-               struct pbr_interface *pbr_ifp;
-
-               pbr_ifp = pbr_if_new(ifp);
-               ifp->info = pbr_ifp;
-       }
+       if (!ifp->info)
+               pbr_if_new(ifp);
 
        return 0;
 }
@@ -225,6 +216,7 @@ static int rule_notify_owner(int command, struct zclient *zclient,
                DEBUGD(&pbr_dbg_zebra, "%s: Recived RULE_INSTALLED",
                       __PRETTY_FUNCTION__);
                break;
+       case ZAPI_RULE_FAIL_REMOVE:
        case ZAPI_RULE_REMOVED:
                pbrms->installed &= ~installed;
                DEBUGD(&pbr_dbg_zebra, "%s: Received RULE REMOVED",
@@ -482,6 +474,7 @@ static void pbr_encode_pbr_map_sequence(struct stream *s,
        stream_putw(s, 0);  /* src port */
        pbr_encode_pbr_map_sequence_prefix(s, pbrms->dst, family);
        stream_putw(s, 0);  /* dst port */
+       stream_putl(s, 0);  /* fwmark */
        if (pbrms->nhgrp_name)
                stream_putl(s, pbr_nht_get_table(pbrms->nhgrp_name));
        else if (pbrms->nhg)
@@ -494,7 +487,7 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms,
 {
        struct pbr_map *pbrm = pbrms->parent;
        struct stream *s;
-       uint64_t is_installed = 1 << pmi->install_bit;
+       uint64_t is_installed = (uint64_t)1 << pmi->install_bit;
 
        is_installed &= pbrms->installed;