diff options
Diffstat (limited to 'zebra')
| -rw-r--r-- | zebra/if_netlink.c | 1 | ||||
| -rw-r--r-- | zebra/interface.c | 2 | ||||
| -rw-r--r-- | zebra/redistribute.c | 12 | ||||
| -rw-r--r-- | zebra/zapi_msg.c | 25 | ||||
| -rw-r--r-- | zebra/zapi_msg.h | 2 | ||||
| -rw-r--r-- | zebra/zebra_dplane.c | 7 | ||||
| -rw-r--r-- | zebra/zebra_dplane.h | 2 | ||||
| -rw-r--r-- | zebra/zebra_nhg.c | 9 | ||||
| -rw-r--r-- | zebra/zebra_pbr.c | 22 |
9 files changed, 41 insertions, 41 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 61a8c6a78a..ed2e0a224e 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -1622,6 +1622,7 @@ int netlink_link_change(struct nlmsghdr *h, ns_id_t ns_id, int startup) zlog_debug( "RTM_NEWLINK for interface %s(%u) without MTU set", name, ifi->ifi_index); + dplane_ctx_fini(&ctx); return 0; } dplane_ctx_set_ifp_mtu(ctx, *(int *)RTA_DATA(tb[IFLA_MTU])); diff --git a/zebra/interface.c b/zebra/interface.c index 92ae8a9dc5..919cd11bc8 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -853,7 +853,7 @@ void if_handle_vrf_change(struct interface *ifp, vrf_id_t vrf_id) if_down_del_nbr_connected(ifp); /* Send out notification on interface VRF change. */ - /* This is to issue an UPDATE or a DELETE, as appropriate. */ + /* This is to issue a DELETE, as appropriate. */ zebra_interface_vrf_update_del(ifp, vrf_id); if (if_is_vrf(ifp)) diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 7aa254b1cb..4069f7dd70 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -592,9 +592,8 @@ void zebra_interface_vrf_update_del(struct interface *ifp, vrf_id_t new_vrf_id) struct zserv *client; if (IS_ZEBRA_DEBUG_EVENT) - zlog_debug( - "MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/DEL %s VRF Id %u -> %u", - ifp->name, ifp->vrf->vrf_id, new_vrf_id); + zlog_debug("MESSAGE: ZEBRA_INTERFACE_DELETE %s VRF Id %u -> %u", + ifp->name, ifp->vrf->vrf_id, new_vrf_id); for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) { /* Do not send unsolicited messages to synchronous clients. */ @@ -606,7 +605,6 @@ void zebra_interface_vrf_update_del(struct interface *ifp, vrf_id_t new_vrf_id) zsend_interface_update(ZEBRA_INTERFACE_DOWN, client, ifp); client->ifdel_cnt++; zsend_interface_delete(client, ifp); - zsend_interface_vrf_update(client, ifp, new_vrf_id); } } @@ -619,9 +617,8 @@ void zebra_interface_vrf_update_add(struct interface *ifp, vrf_id_t old_vrf_id) struct zserv *client; if (IS_ZEBRA_DEBUG_EVENT) - zlog_debug( - "MESSAGE: ZEBRA_INTERFACE_VRF_UPDATE/ADD %s VRF Id %u -> %u", - ifp->name, old_vrf_id, ifp->vrf->vrf_id); + zlog_debug("MESSAGE: ZEBRA_INTERFACE_ADD %s VRF Id %u -> %u", + ifp->name, old_vrf_id, ifp->vrf->vrf_id); for (ALL_LIST_ELEMENTS(zrouter.client_list, node, nnode, client)) { /* Do not send unsolicited messages to synchronous clients. */ @@ -685,6 +682,7 @@ int zebra_add_import_table_entry(struct zebra_vrf *zvrf, struct route_node *rn, copy_nexthops(&ng->nexthop, re->nhe->nhg.nexthop, NULL); rib_add_multipath(afi, SAFI_UNICAST, &p, NULL, newre, ng, false); + nexthop_group_delete(&ng); return 0; } diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index 86e4f2570c..b73511f027 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -435,27 +435,6 @@ int zsend_interface_addresses(struct zserv *client, struct interface *ifp) return 0; } -/* Notify client about interface moving from one VRF to another. - * Whether client is interested in old and new VRF is checked by caller. - */ -int zsend_interface_vrf_update(struct zserv *client, struct interface *ifp, - vrf_id_t vrf_id) -{ - struct stream *s = stream_new(ZEBRA_MAX_PACKET_SIZ); - - zclient_create_header(s, ZEBRA_INTERFACE_VRF_UPDATE, ifp->vrf->vrf_id); - - /* Fill in the name of the interface and its new VRF (id) */ - stream_put(s, ifp->name, INTERFACE_NAMSIZ); - stream_putl(s, vrf_id); - - /* Write packet size. */ - stream_putw_at(s, 0, stream_get_endp(s)); - - client->if_vrfchg_cnt++; - return zserv_send_message(client, s); -} - /* Add new nbr connected IPv6 address */ void nbr_connected_add_ipv6(struct interface *ifp, struct in6_addr *address) { @@ -849,7 +828,9 @@ void zsend_rule_notify_owner(const struct zebra_dplane_ctx *ctx, s = stream_new(ZEBRA_MAX_PACKET_SIZ); - zclient_create_header(s, ZEBRA_RULE_NOTIFY_OWNER, VRF_DEFAULT); + zclient_create_header(s, ZEBRA_RULE_NOTIFY_OWNER, + dplane_ctx_rule_get_vrfid(ctx)); + stream_put(s, ¬e, sizeof(note)); stream_putl(s, dplane_ctx_rule_get_seq(ctx)); stream_putl(s, dplane_ctx_rule_get_priority(ctx)); diff --git a/zebra/zapi_msg.h b/zebra/zapi_msg.h index ce8e154465..a01cbf675d 100644 --- a/zebra/zapi_msg.h +++ b/zebra/zapi_msg.h @@ -57,8 +57,6 @@ extern int zsend_redistribute_route(int cmd, struct zserv *zclient, extern int zsend_router_id_update(struct zserv *zclient, afi_t afi, struct prefix *p, vrf_id_t vrf_id); -extern int zsend_interface_vrf_update(struct zserv *zclient, - struct interface *ifp, vrf_id_t vrf_id); extern int zsend_interface_link_params(struct zserv *zclient, struct interface *ifp); extern int zsend_pw_update(struct zserv *client, struct zebra_pw *pw); diff --git a/zebra/zebra_dplane.c b/zebra/zebra_dplane.c index 03d7bb88a2..099a6e2725 100644 --- a/zebra/zebra_dplane.c +++ b/zebra/zebra_dplane.c @@ -3031,6 +3031,13 @@ void dplane_ctx_rule_set_dp_flow_ptr(struct zebra_dplane_ctx *ctx, ctx->u.rule.new.dp_flow_ptr = dp_flow_ptr; } +vrf_id_t dplane_ctx_rule_get_vrfid(const struct zebra_dplane_ctx *ctx) +{ + DPLANE_CTX_VALID(ctx); + + return ctx->u.rule.new.prule.vrf_id; +} + /*********************************************************************** * PBR RULE ACCESSORS - end **********************************************************************/ diff --git a/zebra/zebra_dplane.h b/zebra/zebra_dplane.h index 4d4a17bbae..87c2e03656 100644 --- a/zebra/zebra_dplane.h +++ b/zebra/zebra_dplane.h @@ -740,6 +740,8 @@ intptr_t dplane_ctx_rule_get_old_dp_flow_ptr(const struct zebra_dplane_ctx *ctx); void dplane_ctx_rule_set_dp_flow_ptr(struct zebra_dplane_ctx *ctx, intptr_t dp_flow_ptr); +vrf_id_t dplane_ctx_rule_get_vrfid(const struct zebra_dplane_ctx *ctx); + /* Accessors for policy based routing iptable information */ struct zebra_pbr_iptable; void dplane_ctx_get_pbr_iptable(const struct zebra_dplane_ctx *ctx, diff --git a/zebra/zebra_nhg.c b/zebra/zebra_nhg.c index d1a84491aa..396e9acfc8 100644 --- a/zebra/zebra_nhg.c +++ b/zebra/zebra_nhg.c @@ -3750,8 +3750,13 @@ void zebra_interface_nhg_reinstall(struct interface *ifp) rb_node_dep->nhe->flags); zebra_nhg_install_kernel(rb_node_dep->nhe); - /* mark depedent uninstall, when interface associated - * singleton is installed, install depedent + /* Don't need to modify dependents if installed */ + if (CHECK_FLAG(rb_node_dep->nhe->flags, + NEXTHOP_GROUP_INSTALLED)) + continue; + + /* mark dependent uninstalled; when interface associated + * singleton is installed, install dependent */ frr_each_safe (nhg_connected_tree, &rb_node_dep->nhe->nhg_dependents, diff --git a/zebra/zebra_pbr.c b/zebra/zebra_pbr.c index 5124768a7c..c04c5f5580 100644 --- a/zebra/zebra_pbr.c +++ b/zebra/zebra_pbr.c @@ -172,10 +172,13 @@ uint32_t zebra_pbr_rules_hash_key(const void *arg) key = jhash_3words(rule->rule.filter.pcp, rule->rule.filter.vlan_id, rule->rule.filter.vlan_flags, key); - return jhash_3words(rule->rule.filter.src_port, - rule->rule.filter.dst_port, - prefix_hash_key(&rule->rule.filter.dst_ip), - jhash_1word(rule->rule.unique, key)); + key = jhash_3words(rule->rule.filter.src_port, + rule->rule.filter.dst_port, + prefix_hash_key(&rule->rule.filter.dst_ip), key); + + key = jhash_2words(rule->rule.unique, rule->sock, key); + + return key; } bool zebra_pbr_rules_hash_equal(const void *arg1, const void *arg2) @@ -191,6 +194,9 @@ bool zebra_pbr_rules_hash_equal(const void *arg1, const void *arg2) if (r1->rule.priority != r2->rule.priority) return false; + if (r1->sock != r2->sock) + return false; + if (r1->rule.unique != r2->rule.unique) return false; @@ -226,6 +232,7 @@ bool zebra_pbr_rules_hash_equal(const void *arg1, const void *arg2) struct pbr_rule_unique_lookup { struct zebra_pbr_rule *rule; + int sock; uint32_t unique; char ifname[INTERFACE_NAMSIZ + 1]; vrf_id_t vrf_id; @@ -236,9 +243,9 @@ static int pbr_rule_lookup_unique_walker(struct hash_bucket *b, void *data) struct pbr_rule_unique_lookup *pul = data; struct zebra_pbr_rule *rule = b->data; - if (pul->unique == rule->rule.unique - && strncmp(pul->ifname, rule->rule.ifname, INTERFACE_NAMSIZ) == 0 - && pul->vrf_id == rule->vrf_id) { + if (pul->sock == rule->sock && pul->unique == rule->rule.unique && + strmatch(pul->ifname, rule->rule.ifname) && + pul->vrf_id == rule->vrf_id) { pul->rule = rule; return HASHWALK_ABORT; } @@ -255,6 +262,7 @@ pbr_rule_lookup_unique(struct zebra_pbr_rule *zrule) strlcpy(pul.ifname, zrule->rule.ifname, INTERFACE_NAMSIZ); pul.rule = NULL; pul.vrf_id = zrule->vrf_id; + pul.sock = zrule->sock; hash_walk(zrouter.rules_hash, &pbr_rule_lookup_unique_walker, &pul); return pul.rule; |
