summaryrefslogtreecommitdiffstats
path: root/zebra
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@users.noreply.github.com>2022-12-19 19:01:43 +0100
committerGitHub <noreply@github.com>2022-12-19 19:01:43 +0100
commite3ba9ce36a8786337a9121d21db47ed97dc22da0 (patch)
treefcf77b91bde4e3b5b650ffd8c03b5f239f9d6cb1 /zebra
parentMerge pull request #12538 from donaldsharp/zebra_crash_in_shutdown (diff)
parentzebra: fix wrong gateway for fpm debug (diff)
downloadfrr-e3ba9ce36a8786337a9121d21db47ed97dc22da0.tar.xz
frr-e3ba9ce36a8786337a9121d21db47ed97dc22da0.zip
Merge pull request #12537 from anlancs/fix/fpm-debug-info
zebra: fix wrong gateway for fpm debug
Diffstat (limited to 'zebra')
-rw-r--r--zebra/zebra_fpm_netlink.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/zebra/zebra_fpm_netlink.c b/zebra/zebra_fpm_netlink.c
index ca897251e..5cefa16cd 100644
--- a/zebra/zebra_fpm_netlink.c
+++ b/zebra/zebra_fpm_netlink.c
@@ -539,10 +539,15 @@ static void zfpm_log_route_info(struct netlink_route_info *ri,
for (i = 0; i < ri->num_nhs; i++) {
nhi = &ri->nhs[i];
- if (ri->af == AF_INET)
- inet_ntop(AF_INET, &nhi->gateway, buf, sizeof(buf));
- else
- inet_ntop(AF_INET6, &nhi->gateway, buf, sizeof(buf));
+ if (nhi->gateway) {
+ if (ri->af == AF_INET)
+ inet_ntop(AF_INET, nhi->gateway, buf,
+ sizeof(buf));
+ else
+ inet_ntop(AF_INET6, nhi->gateway, buf,
+ sizeof(buf));
+ } else
+ strlcpy(buf, "none", sizeof(buf));
zfpm_debug(" Intf: %u, Gateway: %s, Recursive: %s, Type: %s, Encap type: %s",
nhi->if_index, buf, nhi->recursive ? "yes" : "no",