diff options
| -rw-r--r-- | lib/command.h | 1 | ||||
| -rw-r--r-- | ospfd/ospf_dump.c | 14 | ||||
| -rwxr-xr-x | tests/topotests/lib/bmp_collector/bmpserver.py | 15 | ||||
| -rw-r--r-- | zebra/interface.c | 11 | ||||
| -rw-r--r-- | zebra/zebra_vxlan_if.c | 29 |
5 files changed, 30 insertions, 40 deletions
diff --git a/lib/command.h b/lib/command.h index dfd732893b..36ea73811d 100644 --- a/lib/command.h +++ b/lib/command.h @@ -485,7 +485,6 @@ struct cmd_node { /* Graceful Restart cli help strings */ #define GR_CMD "Global Graceful Restart command\n" #define NO_GR_CMD "Undo Global Graceful Restart command\n" -#define GR "Global Graceful Restart - GR Mode\n" #define GR_DISABLE "Global Graceful Restart - Disable Mode\n" #define NO_GR_DISABLE "Undo Global Graceful Restart - Disable Mode\n" #define GR_DEBUG "Graceful Restart - Enable Debug Logs\n" diff --git a/ospfd/ospf_dump.c b/ospfd/ospf_dump.c index 124b38219d..c143173155 100644 --- a/ospfd/ospf_dump.c +++ b/ospfd/ospf_dump.c @@ -1509,16 +1509,16 @@ DEFPY (debug_ospf_gr, if (vty->node == CONFIG_NODE) { if (no) - CONF_DEBUG_OFF(gr, GR); + DEBUG_OFF(gr, GR); else - CONF_DEBUG_ON(gr, GR); + DEBUG_ON(gr, GR); + } else { + if (no) + TERM_DEBUG_OFF(gr, GR); + else + TERM_DEBUG_ON(gr, GR); } - if (no) - TERM_DEBUG_OFF(gr, GR); - else - TERM_DEBUG_ON(gr, GR); - return CMD_SUCCESS; } diff --git a/tests/topotests/lib/bmp_collector/bmpserver.py b/tests/topotests/lib/bmp_collector/bmpserver.py index c42c387563..f19f63bd8a 100755 --- a/tests/topotests/lib/bmp_collector/bmpserver.py +++ b/tests/topotests/lib/bmp_collector/bmpserver.py @@ -73,7 +73,7 @@ def savepid(): pid = open(pid_file, "r").readline().strip() if check_pid(int(pid)): timestamp_print( - "PID file already exists and program still running %s\n" % pid_file + f"PID file already exists and program still running {pid_file}\n" ) return False else: @@ -81,8 +81,7 @@ def savepid(): fd = os.open(pid_file, flags ^ os.O_EXCL, mode) except (OSError, IOError, ValueError): timestamp_print( - "issue accessing PID file %s (most likely permission or ownership)\n" - % pid_file + f"issue accessing PID file {pid_file} (most likely permission or ownership)\n" ) return False @@ -93,9 +92,9 @@ def savepid(): f.close() saved_pid = True except IOError: - timestamp_print("Can not create PID file %s\n" % pid_file) + timestamp_print(f"Can not create PID file {pid_file}\n") return False - timestamp_print("Created PID file %s with value %d\n" % (pid_file, ownid)) + timestamp_print(f"Created PID file {pid_file} with value {ownid}\n") return True @@ -106,9 +105,9 @@ def removepid(): if exc.errno == errno.ENOENT: pass else: - timestamp_print("Can not remove PID file %s\n" % pid_file) + timestamp_print(f"Can not remove PID file {pid_file}\n") return - timestamp_print("Removed PID file %s\n" % pid_file) + timestamp_print(f"Removed PID file {pid_file}\n") def main(): @@ -168,7 +167,7 @@ def main(): timestamp_print(f"TCP session closed with {client_address}") connection.close() except socket.error as sock_err: - timestamp_print(f"Socket error: {e}") + timestamp_print(f"Socket error: {sock_err}") except Exception as e: timestamp_print(f"{e}") finally: diff --git a/zebra/interface.c b/zebra/interface.c index b7a790382d..8080ba01de 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -1728,7 +1728,7 @@ interface_bridge_vxlan_vlan_vni_map_update(struct zebra_dplane_ctx *ctx, dplane_ctx_get_ifp_vxlan_vni_array(ctx); struct zebra_vxlan_vni vni_start, vni_end; struct hash *vni_table = NULL; - struct zebra_vxlan_vni vni, *vnip; + struct zebra_vxlan_vni vni; vni_t vni_id; vlanid_t vid; int i; @@ -1762,11 +1762,8 @@ interface_bridge_vxlan_vlan_vni_map_update(struct zebra_dplane_ctx *ctx, vni_start.vni, vni_end.vni, ifp->name, ifp->ifindex); - if (!vni_table) { + if (!vni_table) vni_table = zebra_vxlan_vni_table_create(); - if (!vni_table) - return; - } for (vid = vni_start.access_vlan, vni_id = vni_start.vni; vid <= vni_end.access_vlan; vid++, vni_id++) { @@ -1774,9 +1771,7 @@ interface_bridge_vxlan_vlan_vni_map_update(struct zebra_dplane_ctx *ctx, memset(&vni, 0, sizeof(vni)); vni.vni = vni_id; vni.access_vlan = vid; - vnip = hash_get(vni_table, &vni, zebra_vxlan_vni_alloc); - if (!vnip) - return; + (void)hash_get(vni_table, &vni, zebra_vxlan_vni_alloc); } memset(&vni_start, 0, sizeof(vni_start)); diff --git a/zebra/zebra_vxlan_if.c b/zebra/zebra_vxlan_if.c index ea0be2f644..4fd9cb6587 100644 --- a/zebra/zebra_vxlan_if.c +++ b/zebra/zebra_vxlan_if.c @@ -54,6 +54,8 @@ #include "zebra/zebra_evpn_vxlan.h" #include "zebra/zebra_router.h" +DEFINE_MTYPE_STATIC(ZEBRA, L2_VNI, "L2 VNI"); + static unsigned int zebra_vxlan_vni_hash_keymake(const void *p) { const struct zebra_vxlan_vni *vni; @@ -527,11 +529,7 @@ static int zebra_vxlan_if_add_update_vni(struct zebra_if *zif, old_vni->access_vlan, vni->vni, vni->access_vlan); - zebra_evpn_vl_vxl_deref(old_vni->access_vlan, old_vni->vni, - zif); - zebra_evpn_vl_vxl_ref(vni->access_vlan, vni->vni, zif); - zebra_vxlan_if_update_vni(zif->ifp, vni, ctx); - zebra_vxlan_vni_free(old_vni); + } else { int ret; @@ -544,19 +542,20 @@ static int zebra_vxlan_if_add_update_vni(struct zebra_if *zif, if (IS_ZEBRA_DEBUG_VXLAN) zlog_debug("%s vxlan %s vni %u has error accessing bridge table.", __func__, zif->ifp->name, vni->vni); + + return 0; } else if (ret == 0) { if (IS_ZEBRA_DEBUG_VXLAN) zlog_debug("%s vxlan %s vni (%u, %u) not present in bridge table", - __func__, zif->ifp->name, vni->vni, - vni->access_vlan); - zebra_evpn_vl_vxl_deref(old_vni->access_vlan, - old_vni->vni, zif); - zebra_evpn_vl_vxl_ref(vni->access_vlan, vni->vni, zif); - zebra_vxlan_if_update_vni(zif->ifp, vni, ctx); - zebra_vxlan_vni_free(old_vni); + __func__, zif->ifp->name, vni->vni, vni->access_vlan); } } + zebra_evpn_vl_vxl_deref(old_vni->access_vlan, old_vni->vni, zif); + zebra_evpn_vl_vxl_ref(vni->access_vlan, vni->vni, zif); + zebra_vxlan_if_update_vni(zif->ifp, vni, ctx); + zebra_vxlan_vni_free(old_vni); + return 0; } @@ -608,7 +607,7 @@ void zebra_vxlan_vni_free(void *arg) vni = (struct zebra_vxlan_vni *)arg; - XFREE(MTYPE_TMP, vni); + XFREE(MTYPE_L2_VNI, vni); } void *zebra_vxlan_vni_alloc(void *p) @@ -617,7 +616,7 @@ void *zebra_vxlan_vni_alloc(void *p) const struct zebra_vxlan_vni *vnip; vnip = (const struct zebra_vxlan_vni *)p; - vni = XCALLOC(MTYPE_TMP, sizeof(*vni)); + vni = XCALLOC(MTYPE_L2_VNI, sizeof(*vni)); vni->vni = vnip->vni; vni->access_vlan = vnip->access_vlan; vni->mcast_grp = vnip->mcast_grp; @@ -659,8 +658,6 @@ int zebra_vxlan_if_vni_table_create(struct zebra_if *zif) vni_info = VNI_INFO_FROM_ZEBRA_IF(zif); vni_info->vni_table = zebra_vxlan_vni_table_create(); - if (!vni_info->vni_table) - return -ENOMEM; return 0; } |
