diff options
| -rw-r--r-- | bgpd/bgp_attr.c | 5 | ||||
| -rw-r--r-- | bgpd/bgp_evpn_vty.c | 21 | ||||
| -rw-r--r-- | bgpd/bgp_route.c | 3 | ||||
| -rw-r--r-- | debian/README.Debian | 2 | ||||
| -rw-r--r-- | doc/user/pim.rst | 7 | ||||
| -rw-r--r-- | isisd/isisd.c | 7 | ||||
| -rw-r--r-- | yang/frr-isisd.yang | 6 | ||||
| -rw-r--r-- | zebra/debug.c | 30 | ||||
| -rw-r--r-- | zebra/debug.h | 9 | ||||
| -rw-r--r-- | zebra/if_netlink.c | 2 | ||||
| -rw-r--r-- | zebra/kernel_netlink.c | 12 | ||||
| -rw-r--r-- | zebra/rt_netlink.c | 32 | ||||
| -rw-r--r-- | zebra/rtadv.c | 17 | ||||
| -rw-r--r-- | zebra/zapi_msg.c | 15 | ||||
| -rw-r--r-- | zebra/zebra_rib.c | 14 |
15 files changed, 122 insertions, 60 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index fe7a80ccf2..bdac2a8dcc 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -152,8 +152,9 @@ static bool cluster_hash_cmp(const void *p1, const void *p2) const struct cluster_list *cluster2 = p2; return (cluster1->length == cluster2->length - && memcmp(cluster1->list, cluster2->list, cluster1->length) - == 0); + && (cluster1->list == cluster2->list + || memcmp(cluster1->list, cluster2->list, cluster1->length) + == 0)); } static void cluster_free(struct cluster_list *cluster) diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index d316a28dcb..3049a00ce3 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -5620,19 +5620,24 @@ void bgp_config_write_evpn_info(struct vty *vty, struct bgp *bgp, afi_t afi, if (!bgp->evpn_info->advertise_pip) vty_out(vty, " no advertise-pip\n"); if (bgp->evpn_info->advertise_pip) { - if (bgp->evpn_info->pip_ip_static.s_addr != INADDR_ANY) + if (bgp->evpn_info->pip_ip_static.s_addr + != INADDR_ANY) { vty_out(vty, " advertise-pip ip %s", inet_ntop(AF_INET, &bgp->evpn_info->pip_ip_static, buf2, INET_ADDRSTRLEN)); - if (!is_zero_mac(&(bgp->evpn_info->pip_rmac_static))) { - char buf[ETHER_ADDR_STRLEN]; - - vty_out(vty, " mac %s", - prefix_mac2str(&bgp->evpn_info->pip_rmac, - buf, sizeof(buf))); + if (!is_zero_mac(&( + bgp->evpn_info->pip_rmac_static))) { + char buf[ETHER_ADDR_STRLEN]; + + vty_out(vty, " mac %s", + prefix_mac2str( + &bgp->evpn_info + ->pip_rmac, + buf, sizeof(buf))); + } + vty_out(vty, "\n"); } - vty_out(vty, "\n"); } } if (CHECK_FLAG(bgp->vrf_flags, BGP_VRF_RD_CFGD)) diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 21d737fb32..b216f85c40 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -4515,7 +4515,8 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr, if (pnt + BGP_ADDPATH_ID_LEN >= lim) return BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW; - addpath_id = ntohl(*((uint32_t *)pnt)); + memcpy(&addpath_id, pnt, 4); + addpath_id = ntohl(addpath_id); pnt += BGP_ADDPATH_ID_LEN; } diff --git a/debian/README.Debian b/debian/README.Debian index 47a353310d..cbd70f82f6 100644 --- a/debian/README.Debian +++ b/debian/README.Debian @@ -61,7 +61,7 @@ OpenSSL now is not compatible with the GNU GENERAL PUBLIC LICENSE (GPL) licence that FRR is distributed under. For more explanation read: http://www.gnome.org/~markmc/openssl-and-the-gpl.html http://www.gnu.org/licenses/gpl-faq.html#GPLIncompatibleLibs -Updating the licence to explecitly allow linking against OpenSSL +Updating the licence to explicitly allow linking against OpenSSL would requite the affirmation of all people that ever contributed a significant part to Zebra / Quagga or FRR and thus are the collective "copyright holder". That's too much work. Using a shrinked down diff --git a/doc/user/pim.rst b/doc/user/pim.rst index 9267095b3e..6bda692607 100644 --- a/doc/user/pim.rst +++ b/doc/user/pim.rst @@ -11,6 +11,13 @@ vrf aware and can work within the context of vrf's in order to do S,G mrouting. Additionally PIM can be used in the EVPN underlay network for optimizing forwarding of overlay BUM traffic. +.. note:: + + On Linux for PIM-SM operation you *must* have kernel version 4.18 or greater. + To use PIM for EVPN BUM forwarding, kernels 5.0 or greater are required. + OpenBSD has no multicast support and FreeBSD, NetBSD and Solaris only + have support for SSM. + .. _starting-and-stopping-pimd: Starting and Stopping pimd diff --git a/isisd/isisd.c b/isisd/isisd.c index f15d7a9c7e..47d2e9faab 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -107,13 +107,10 @@ struct isis_area *isis_area_create(const char *area_tag) /* * Fabricd runs only as level-2. - * For IS-IS, the first instance is level-1-2 rest are level-1, - * unless otherwise configured + * For IS-IS, the default is level-1-2 */ - if (fabricd) { + if (fabricd) area->is_type = IS_LEVEL_2; - } else if (listcount(isis->area_list) == 0) - area->is_type = IS_LEVEL_1_AND_2; else area->is_type = yang_get_default_enum( "/frr-isisd:isis/instance/is-type"); diff --git a/yang/frr-isisd.yang b/yang/frr-isisd.yang index faa880eff4..faab1e55b2 100644 --- a/yang/frr-isisd.yang +++ b/yang/frr-isisd.yang @@ -27,6 +27,10 @@ module frr-isisd { description "This module defines a model for managing FRR isisd daemon."; + revision 2019-12-17 { + description + "Changed default area is-type to level-1-2"; + } revision 2019-09-09 { description "Changed interface references to use @@ -748,7 +752,7 @@ module frr-isisd { leaf is-type { type level; - default "level-1"; + default "level-1-2"; description "Level of the IS-IS routing instance (OSI only)."; } diff --git a/zebra/debug.c b/zebra/debug.c index 8e5fb0ea10..681dfb8753 100644 --- a/zebra/debug.c +++ b/zebra/debug.c @@ -39,6 +39,7 @@ unsigned long zebra_debug_vxlan; unsigned long zebra_debug_pw; unsigned long zebra_debug_dplane; unsigned long zebra_debug_mlag; +unsigned long zebra_debug_nexthop; DEFINE_HOOK(zebra_debug_show_debugging, (struct vty *vty), (vty)); @@ -103,6 +104,10 @@ DEFUN_NOSH (show_debugging_zebra, vty_out(vty, " Zebra dataplane debugging is on\n"); if (IS_ZEBRA_DEBUG_MLAG) vty_out(vty, " Zebra mlag debugging is on\n"); + if (IS_ZEBRA_DEBUG_NHG_DETAIL) + vty_out(vty, "Zebra detailed nexthop debugging is on\n"); + else if (IS_ZEBRA_DEBUG_NHG) + vty_out(vty, "Zebra nexthop debugging is on\n"); hook_call(zebra_debug_show_debugging, vty); return CMD_SUCCESS; @@ -443,6 +448,28 @@ DEFUN (no_debug_zebra_dplane, return CMD_SUCCESS; } +DEFPY (debug_zebra_nexthop, + debug_zebra_nexthop_cmd, + "[no$no] debug zebra nexthop [detail$detail]", + NO_STR + DEBUG_STR + "Zebra configuration\n" + "Debug zebra nexthop events\n" + "Detailed information\n") +{ + if (no) + zebra_debug_nexthop = 0; + else { + SET_FLAG(zebra_debug_nexthop, ZEBRA_DEBUG_NHG); + + if (detail) + SET_FLAG(zebra_debug_nexthop, + ZEBRA_DEBUG_NHG_DETAILED); + } + + return CMD_SUCCESS; +} + /* Debug node. */ struct cmd_node debug_node = {DEBUG_NODE, "", /* Debug node has no interface. */ 1}; @@ -546,6 +573,7 @@ void zebra_debug_init(void) zebra_debug_dplane = 0; zebra_debug_mlag = 0; zebra_debug_nht = 0; + zebra_debug_nexthop = 0; install_node(&debug_node, config_write_debug); @@ -563,6 +591,7 @@ void zebra_debug_init(void) install_element(ENABLE_NODE, &debug_zebra_fpm_cmd); install_element(ENABLE_NODE, &debug_zebra_dplane_cmd); install_element(ENABLE_NODE, &debug_zebra_mlag_cmd); + install_element(ENABLE_NODE, &debug_zebra_nexthop_cmd); install_element(ENABLE_NODE, &no_debug_zebra_events_cmd); install_element(ENABLE_NODE, &no_debug_zebra_nht_cmd); install_element(ENABLE_NODE, &no_debug_zebra_mpls_cmd); @@ -585,6 +614,7 @@ void zebra_debug_init(void) install_element(CONFIG_NODE, &debug_zebra_rib_cmd); install_element(CONFIG_NODE, &debug_zebra_fpm_cmd); install_element(CONFIG_NODE, &debug_zebra_dplane_cmd); + install_element(CONFIG_NODE, &debug_zebra_nexthop_cmd); install_element(CONFIG_NODE, &no_debug_zebra_events_cmd); install_element(CONFIG_NODE, &no_debug_zebra_nht_cmd); install_element(CONFIG_NODE, &no_debug_zebra_mpls_cmd); diff --git a/zebra/debug.h b/zebra/debug.h index 176226f7ae..e513f8865d 100644 --- a/zebra/debug.h +++ b/zebra/debug.h @@ -59,6 +59,9 @@ extern "C" { #define ZEBRA_DEBUG_MLAG 0x01 +#define ZEBRA_DEBUG_NHG 0x01 +#define ZEBRA_DEBUG_NHG_DETAILED 0x02 + /* Debug related macro. */ #define IS_ZEBRA_DEBUG_EVENT (zebra_debug_event & ZEBRA_DEBUG_EVENT) @@ -92,6 +95,11 @@ extern "C" { #define IS_ZEBRA_DEBUG_MLAG (zebra_debug_mlag & ZEBRA_DEBUG_MLAG) +#define IS_ZEBRA_DEBUG_NHG (zebra_debug_nexthop & ZEBRA_DEBUG_NHG) + +#define IS_ZEBRA_DEBUG_NHG_DETAIL \ + (zebra_debug_nexthop & ZEBRA_DEBUG_NHG_DETAILED) + extern unsigned long zebra_debug_event; extern unsigned long zebra_debug_packet; extern unsigned long zebra_debug_kernel; @@ -103,6 +111,7 @@ extern unsigned long zebra_debug_vxlan; extern unsigned long zebra_debug_pw; extern unsigned long zebra_debug_dplane; extern unsigned long zebra_debug_mlag; +extern unsigned long zebra_debug_nexthop; extern void zebra_debug_init(void); diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index eae5d2b854..4731d1ed15 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -1467,7 +1467,7 @@ int netlink_protodown(struct interface *ifp, bool down) req.ifa.ifi_index = ifp->ifindex; - addattr_l(&req.n, sizeof(req), IFLA_PROTO_DOWN, &down, 4); + addattr_l(&req.n, sizeof(req), IFLA_PROTO_DOWN, &down, sizeof(down)); addattr_l(&req.n, sizeof(req), IFLA_LINK, &ifp->ifindex, 4); return netlink_talk(netlink_talk_filter, &req.n, &zns->netlink_cmd, zns, diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 3bceb56359..c3d5bf8428 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -290,6 +290,18 @@ static int netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id, return netlink_neigh_change(h, ns_id); case RTM_DELNEIGH: return netlink_neigh_change(h, ns_id); + case RTM_GETNEIGH: + /* + * Kernel in some situations when it expects + * user space to resolve arp entries, we will + * receive this notification. As we don't + * need this notification and as that + * we don't want to spam the log file with + * below messages, just ignore. + */ + if (IS_ZEBRA_DEBUG_KERNEL) + zlog_debug("Received RTM_GETNEIGH, ignoring"); + break; case RTM_NEWRULE: return netlink_rule_change(h, ns_id, startup); case RTM_DELRULE: diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index fff569c092..29a341abbd 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -787,34 +787,10 @@ static int netlink_route_change_read_unicast(struct nlmsghdr *h, ns_id_t ns_id, } else { if (!tb[RTA_MULTIPATH]) { struct nexthop nh; - size_t sz = (afi == AFI_IP) ? 4 : 16; - - memset(&nh, 0, sizeof(nh)); - if (bh_type == BLACKHOLE_UNSPEC) { - if (index && !gate) - nh.type = NEXTHOP_TYPE_IFINDEX; - else if (index && gate) - nh.type = - (afi == AFI_IP) - ? NEXTHOP_TYPE_IPV4_IFINDEX - : NEXTHOP_TYPE_IPV6_IFINDEX; - else if (!index && gate) - nh.type = - (afi == AFI_IP) - ? NEXTHOP_TYPE_IPV4 - : NEXTHOP_TYPE_IPV6; - else { - nh.type = - NEXTHOP_TYPE_BLACKHOLE; - nh.bh_type = BLACKHOLE_UNSPEC; - } - } else { - nh.type = NEXTHOP_TYPE_BLACKHOLE; - nh.bh_type = bh_type; - } - nh.ifindex = index; - if (gate) - memcpy(&nh.gate, gate, sz); + + nh = parse_nexthop_unicast( + ns_id, rtm, tb, bh_type, index, prefsrc, + gate, afi, vrf_id); rib_delete(afi, SAFI_UNICAST, vrf_id, proto, 0, flags, &p, &src_p, &nh, 0, table, metric, distance, true); diff --git a/zebra/rtadv.c b/zebra/rtadv.c index 5dd6012f62..e9a97d4b15 100644 --- a/zebra/rtadv.c +++ b/zebra/rtadv.c @@ -965,16 +965,25 @@ static void zebra_interface_radv_set(ZAPI_HANDLER_ARGS, int enable) ifindex_t ifindex; struct interface *ifp; struct zebra_if *zif; - int ra_interval; + int ra_interval_rxd; s = msg; /* Get interface index and RA interval. */ STREAM_GETL(s, ifindex); - STREAM_GETL(s, ra_interval); + STREAM_GETL(s, ra_interval_rxd); + + if (ra_interval_rxd < 0) { + zlog_warn( + "Requested RA interval %d is garbage; ignoring request", + ra_interval_rxd); + return; + } + + unsigned int ra_interval = ra_interval_rxd; if (IS_ZEBRA_DEBUG_EVENT) - zlog_debug("%u: IF %u RA %s from client %s, interval %ds", + zlog_debug("%u: IF %u RA %s from client %s, interval %ums", zvrf_id(zvrf), ifindex, enable ? "enable" : "disable", zebra_route_string(client->proto), ra_interval); @@ -1001,7 +1010,7 @@ static void zebra_interface_radv_set(ZAPI_HANDLER_ARGS, int enable) SET_FLAG(zif->rtadv.ra_configured, BGP_RA_CONFIGURED); ipv6_nd_suppress_ra_set(ifp, RA_ENABLE); if (ra_interval - && (ra_interval * 1000) < zif->rtadv.MaxRtrAdvInterval + && (ra_interval * 1000) < (unsigned int) zif->rtadv.MaxRtrAdvInterval && !CHECK_FLAG(zif->rtadv.ra_configured, VTY_RA_INTERVAL_CONFIGURED)) zif->rtadv.MaxRtrAdvInterval = ra_interval * 1000; diff --git a/zebra/zapi_msg.c b/zebra/zapi_msg.c index bb2e55c87a..df41220c5d 100644 --- a/zebra/zapi_msg.c +++ b/zebra/zapi_msg.c @@ -2361,6 +2361,20 @@ static inline void zread_rule(ZAPI_HANDLER_ARGS) if (zpr.rule.filter.fwmark) zpr.rule.filter.filter_bm |= PBR_FILTER_FWMARK; + if (!(zpr.rule.filter.src_ip.family == AF_INET + || zpr.rule.filter.src_ip.family == AF_INET6)) { + zlog_warn("Unsupported PBR source IP family: %s\n", + family2str(zpr.rule.filter.src_ip.family)); + return; + } + if (!(zpr.rule.filter.dst_ip.family == AF_INET + || zpr.rule.filter.dst_ip.family == AF_INET6)) { + zlog_warn("Unsupported PBR dest IP family: %s\n", + family2str(zpr.rule.filter.dst_ip.family)); + return; + } + + zpr.vrf_id = zvrf->vrf->vrf_id; if (hdr->command == ZEBRA_RULE_ADD) zebra_pbr_add_rule(&zpr); @@ -2417,6 +2431,7 @@ static inline void zread_ipset_entry(ZAPI_HANDLER_ARGS) zpi.sock = client->sock; STREAM_GETL(s, zpi.unique); STREAM_GET(&ipset.ipset_name, s, ZEBRA_IPSET_NAME_SIZE); + ipset.ipset_name[ZEBRA_IPSET_NAME_SIZE - 1] = '\0'; STREAM_GETC(s, zpi.src.family); STREAM_GETC(s, zpi.src.prefixlen); STREAM_GET(&zpi.src.u.prefix, s, prefix_blen(&zpi.src)); diff --git a/zebra/zebra_rib.c b/zebra/zebra_rib.c index 309b0f4301..051d7f5231 100644 --- a/zebra/zebra_rib.c +++ b/zebra/zebra_rib.c @@ -1898,11 +1898,6 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx) /* Redistribute, lsp, and nht update */ redistribute_update(dest_pfx, src_pfx, re, NULL); - zebra_rib_evaluate_rn_nexthops( - rn, zebra_router_get_next_sequence()); - - zebra_rib_evaluate_mpls(rn); - } else if (start_count > 0 && end_count == 0) { if (debug_p) zlog_debug("%u:%s un-installed transition from dplane notification", @@ -1921,12 +1916,13 @@ static void rib_process_dplane_notify(struct zebra_dplane_ctx *ctx) /* Redistribute, lsp, and nht update */ redistribute_delete(dest_pfx, src_pfx, re, NULL); + } - zebra_rib_evaluate_rn_nexthops( - rn, zebra_router_get_next_sequence()); + /* Make any changes visible for lsp and nexthop-tracking processing */ + zebra_rib_evaluate_rn_nexthops( + rn, zebra_router_get_next_sequence()); - zebra_rib_evaluate_mpls(rn); - } + zebra_rib_evaluate_mpls(rn); done: if (rn) |
