diff options
| author | Jafar Al-Gharaibeh <Jafaral@users.noreply.github.com> | 2021-10-12 11:15:39 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-12 11:15:39 -0500 |
| commit | 38e7e55306fd242cd4cd7a1113cefe28284f57a8 (patch) | |
| tree | 8b20323069094ba5f28355ac0bef47ec6b877d21 /zebra/if_netlink.c | |
| parent | ba3df8987f987585efeab9dcef839d0122d50a16 (diff) | |
| parent | 8eec31ef564dcf4e096e700a648570973ca4e96b (diff) | |
Merge pull request #9655 from yyuanam/first_commit
Zebra: Ignore the failure of startup intf lookup.
Diffstat (limited to 'zebra/if_netlink.c')
| -rw-r--r-- | zebra/if_netlink.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/zebra/if_netlink.c b/zebra/if_netlink.c index 9385418655..fa3aabb195 100644 --- a/zebra/if_netlink.c +++ b/zebra/if_netlink.c @@ -1292,11 +1292,22 @@ int netlink_interface_addr(struct nlmsghdr *h, ns_id_t ns_id, int startup) ifp = if_lookup_by_index_per_ns(zns, ifa->ifa_index); if (ifp == NULL) { - flog_err( - EC_LIB_INTERFACE, - "netlink_interface_addr can't find interface by index %d", - ifa->ifa_index); - return -1; + if (startup) { + /* During startup, failure to lookup the referenced + * interface should not be an error, so we have + * downgraded this condition to warning, and we permit + * the startup interface state retrieval to continue. + */ + flog_warn(EC_LIB_INTERFACE, + "%s: can't find interface by index %d", + __func__, ifa->ifa_index); + return 0; + } else { + flog_err(EC_LIB_INTERFACE, + "%s: can't find interface by index %d", + __func__, ifa->ifa_index); + return -1; + } } /* Flags passed through */ |
