diff options
| author | anlan_cs <vic.lan@pica8.com> | 2022-09-06 01:34:11 -0400 | 
|---|---|---|
| committer | anlan_cs <vic.lan@pica8.com> | 2022-09-08 06:27:01 -0400 | 
| commit | f09428e472512eaec2641524f30934a0b6a3012e (patch) | |
| tree | 481d32f24a017f8b9ffab2f01d3061b29816d844 /zebra/kernel_netlink.c | |
| parent | 340ed5f9e20871bd8ae391cb06432138e1fa11b7 (diff) | |
zebra: fix broken evpn
To resolve link dependencies of unordered interfaces, the commit
`520ebf72b27c2462ce8b0dc5a1d4cb83956df69c` has separated assignment of
`zif->link_ifindex` and `zif->link` from `netlink_interface()` during startup.
The fixup stage of `zebra_if_update_all_links()` goes into the last of
`interface_lookup_netlink()`, it can't be executed in the case of error in
above `netlink_parse_info()`s.
`RTM_GETTUNNEL` is not supported in linux kernel until 5.18, so
`netlink_parse_info()` will throw error with the previous versions.
If two conditions are met, (it is a common case)
1. Interfaces are created before frr restart/start
2. Linux kernel version < 5.18
the link dependencies will not be done, then evpn feature will be broken.
IMO we should just ignore this error.
Signed-off-by: anlan_cs <vic.lan@pica8.com>
Diffstat (limited to 'zebra/kernel_netlink.c')
| -rw-r--r-- | zebra/kernel_netlink.c | 18 | 
1 files changed, 12 insertions, 6 deletions
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c index 45a372f88c..a8b56bb8f2 100644 --- a/zebra/kernel_netlink.c +++ b/zebra/kernel_netlink.c @@ -1033,12 +1033,18 @@ static int netlink_parse_error(const struct nlsock *nl, struct nlmsghdr *h,  		return 1;  	} -	/* Deal with errors that occur because of races in link handling. */ -	if (is_cmd -	    && ((msg_type == RTM_DELROUTE -		 && (-errnum == ENODEV || -errnum == ESRCH)) -		|| (msg_type == RTM_NEWROUTE -		    && (-errnum == ENETDOWN || -errnum == EEXIST)))) { +	/* +	 * Deal with errors that occur because of races in link handling +	 * or types are not supported in kernel. +	 */ +	if (is_cmd && +	    ((msg_type == RTM_DELROUTE && +	      (-errnum == ENODEV || -errnum == ESRCH)) || +	     (msg_type == RTM_NEWROUTE && +	      (-errnum == ENETDOWN || -errnum == EEXIST)) || +	     ((msg_type == RTM_NEWTUNNEL || msg_type == RTM_DELTUNNEL || +	       msg_type == RTM_GETTUNNEL) && +	      (-errnum == EOPNOTSUPP)))) {  		if (IS_ZEBRA_DEBUG_KERNEL)  			zlog_debug("%s: error: %s type=%s(%u), seq=%u, pid=%u",  				   nl->name, safe_strerror(-errnum),  | 
