]> git.puffer.fish Git - mirror/frr.git/commitdiff
zebra: fix broken evpn 11922/head
authoranlan_cs <vic.lan@pica8.com>
Tue, 6 Sep 2022 05:34:11 +0000 (01:34 -0400)
committeranlan_cs <vic.lan@pica8.com>
Thu, 8 Sep 2022 10:27:01 +0000 (06:27 -0400)
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>
zebra/kernel_netlink.c

index 45a372f88c9e5e78ec5a4177e64a251009079948..a8b56bb8f2aaec18b7d8cca85804b42d00294c9c 100644 (file)
@@ -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),