diff options
| -rw-r--r-- | doc/user/zebra.rst | 10 | ||||
| -rw-r--r-- | ospfd/ospf_vty.c | 7 | ||||
| -rw-r--r-- | ospfd/ospfd.c | 26 | ||||
| -rw-r--r-- | ospfd/ospfd.h | 2 | ||||
| -rw-r--r-- | zebra/interface.c | 12 | ||||
| -rw-r--r-- | zebra/rt_netlink.c | 2 | ||||
| -rw-r--r-- | zebra/zapi_msg.c | 4 | ||||
| -rw-r--r-- | zebra/zebra_router.c | 1 | ||||
| -rw-r--r-- | zebra/zebra_vrf.c | 1 |
9 files changed, 43 insertions, 22 deletions
diff --git a/doc/user/zebra.rst b/doc/user/zebra.rst index dc2c95cd7a..14b78f8776 100644 --- a/doc/user/zebra.rst +++ b/doc/user/zebra.rst @@ -140,16 +140,6 @@ Standard Commands behind the other end of the link (or even on the link in Point-to-Multipoint setups), though generally /32s are used. -.. index:: ip address ADDRESS/PREFIX secondary - -.. clicmd:: ip address ADDRESS/PREFIX secondary -.. index:: no ip address ADDRESS/PREFIX secondary - -.. clicmd:: no ip address ADDRESS/PREFIX secondary - - Set the secondary flag for this address. This causes ospfd to not treat the - address as a distinct subnet. - .. index:: description DESCRIPTION ... .. clicmd:: description DESCRIPTION ... diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index 52652821d6..67f5c7e890 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -245,8 +245,11 @@ DEFUN_NOSH (router_ospf, return ret; } } - ospf_interface_area_set(ospf, ifp); - ospf->if_ospf_cli_count++; + if (!ospf_interface_area_is_already_set(ospf, + ifp)) { + ospf_interface_area_set(ospf, ifp); + ospf->if_ospf_cli_count++; + } } } diff --git a/ospfd/ospfd.c b/ospfd/ospfd.c index d5d1a7a605..a18e2de725 100644 --- a/ospfd/ospfd.c +++ b/ospfd/ospfd.c @@ -1149,6 +1149,32 @@ void ospf_interface_area_unset(struct ospf *ospf, struct interface *ifp) update_redistributed(ospf, 0); /* interfaces possibly removed */ } +bool ospf_interface_area_is_already_set(struct ospf *ospf, + struct interface *ifp) +{ + struct route_node *rn_oi; + + if (!ospf) + return false; /* Ospf not ready yet */ + + /* Find interfaces that may need to be removed. */ + for (rn_oi = route_top(IF_OIFS(ifp)); rn_oi; + rn_oi = route_next(rn_oi)) { + struct ospf_interface *oi = rn_oi->info; + + if (oi == NULL) + continue; + + if (oi->type == OSPF_IFTYPE_VIRTUALLINK) + continue; + /* at least one route covered by interface + * that implies already done + */ + return true; + } + return false; +} + /* Check whether interface matches given network * returns: 1, true. 0, false */ diff --git a/ospfd/ospfd.h b/ospfd/ospfd.h index bc9c68d570..cbea033b73 100644 --- a/ospfd/ospfd.h +++ b/ospfd/ospfd.h @@ -561,6 +561,8 @@ extern void ospf_area_del_if(struct ospf_area *, struct ospf_interface *); extern void ospf_interface_area_set(struct ospf *, struct interface *); extern void ospf_interface_area_unset(struct ospf *, struct interface *); +extern bool ospf_interface_area_is_already_set(struct ospf *ospf, + struct interface *ifp); extern void ospf_route_map_init(void); diff --git a/zebra/interface.c b/zebra/interface.c index 76e0a09c17..5b866baaac 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -2767,7 +2767,7 @@ DEFUN (no_ip_address_label, static int ipv6_address_install(struct vty *vty, struct interface *ifp, const char *addr_str, const char *peer_str, - const char *label, int secondary) + const char *label) { struct zebra_if *if_data; struct prefix_ipv6 cp; @@ -2798,10 +2798,6 @@ static int ipv6_address_install(struct vty *vty, struct interface *ifp, *p = cp; ifc->address = (struct prefix *)p; - /* Secondary. */ - if (secondary) - SET_FLAG(ifc->flags, ZEBRA_IFA_SECONDARY); - /* Label. */ if (label) ifc->label = XSTRDUP(MTYPE_CONNECTED_LABEL, label); @@ -2857,7 +2853,7 @@ int ipv6_address_configured(struct interface *ifp) static int ipv6_address_uninstall(struct vty *vty, struct interface *ifp, const char *addr_str, const char *peer_str, - const char *label, int secondry) + const char *label) { struct prefix_ipv6 cp; struct connected *ifc; @@ -2915,7 +2911,7 @@ DEFUN (ipv6_address, int idx_ipv6_prefixlen = 2; VTY_DECLVAR_CONTEXT(interface, ifp); return ipv6_address_install(vty, ifp, argv[idx_ipv6_prefixlen]->arg, - NULL, NULL, 0); + NULL, NULL); } DEFUN (no_ipv6_address, @@ -2929,7 +2925,7 @@ DEFUN (no_ipv6_address, int idx_ipv6_prefixlen = 3; VTY_DECLVAR_CONTEXT(interface, ifp); return ipv6_address_uninstall(vty, ifp, argv[idx_ipv6_prefixlen]->arg, - NULL, NULL, 0); + NULL, NULL); } static int link_params_config_write(struct vty *vty, struct interface *ifp) diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index a65d477f03..da74a757bf 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1711,6 +1711,8 @@ static int netlink_route_multipath(int cmd, struct zebra_dplane_ctx *ctx) setsrc = 1; } } + + continue; } if ((cmd == RTM_NEWROUTE diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 83b4ffa832..b93911bee7 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -248,7 +248,7 @@ int zsend_interface_link_params(struct zserv *client, struct interface *ifp) * RTM_IFANNOUNCE or AF_NETLINK sockets is available), or when * an interface is marked IFF_UP (i.e., an RTM_IFINFO message is * received) - * - for the vty commands "ip address A.B.C.D/M [<secondary>|<label LINE>]" + * - for the vty commands "ip address A.B.C.D/M [<label LINE>]" * and "no bandwidth <1-10000000>", "ipv6 address X:X::X:X/M" * - when an RTM_NEWADDR message is received from the kernel, * @@ -269,7 +269,7 @@ int zsend_interface_link_params(struct zserv *client, struct interface *ifp) * | * vty commands: * "no ip address A.B.C.D/M [label LINE]" - * "no ip address A.B.C.D/M secondary" + * "no ip address A.B.C.D/M" * ["no ipv6 address X:X::X:X/M"] * */ diff --git a/zebra/zebra_router.c b/zebra/zebra_router.c index 99d96fd67f..afe3c708a0 100644 --- a/zebra/zebra_router.c +++ b/zebra/zebra_router.c @@ -96,6 +96,7 @@ struct route_table *zebra_router_get_table(struct zebra_vrf *zvrf, zrt = XCALLOC(MTYPE_ZEBRA_NS, sizeof(*zrt)); zrt->tableid = tableid; zrt->afi = afi; + zrt->safi = safi; zrt->ns_id = zvrf->zns->ns_id; zrt->table = (afi == AFI_IP6) ? srcdest_table_init() : route_table_init(); diff --git a/zebra/zebra_vrf.c b/zebra/zebra_vrf.c index e98a533609..38b8b43d73 100644 --- a/zebra/zebra_vrf.c +++ b/zebra/zebra_vrf.c @@ -380,6 +380,7 @@ static void zebra_vrf_table_create(struct zebra_vrf *zvrf, afi_t afi, table->cleanup = zebra_rtable_node_cleanup; zvrf->table[afi][safi] = table; + XFREE(MTYPE_RIB_TABLE_INFO, table->info); info = XCALLOC(MTYPE_RIB_TABLE_INFO, sizeof(*info)); info->zvrf = zvrf; info->afi = afi; |
