]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/kernel_netlink.c
OSPFD: Update Segment Routing following reviews
[mirror_frr.git] / zebra / kernel_netlink.c
index dfc3f6211db3888ed33942197bbbab5e3c8443f8..1be2cbcaf54ea27b974cacfee3a58f9cb9a2bd5b 100644 (file)
@@ -40,6 +40,7 @@
 #include "zebra/zserv.h"
 #include "zebra/zebra_ns.h"
 #include "zebra/zebra_vrf.h"
+#include "zebra/rt.h"
 #include "zebra/debug.h"
 #include "zebra/kernel_netlink.h"
 #include "zebra/rt_netlink.h"
@@ -262,8 +263,9 @@ static int netlink_information_fetch(struct sockaddr_nl *snl,
                return netlink_neigh_change(snl, h, ns_id);
                break;
        default:
-               zlog_warn("Unknown netlink nlmsg_type %d vrf %u\n",
-                         h->nlmsg_type, ns_id);
+               if (IS_ZEBRA_DEBUG_KERNEL)
+                       zlog_debug("Unknown netlink nlmsg_type %d vrf %u\n",
+                                  h->nlmsg_type, ns_id);
                break;
        }
        return 0;
@@ -675,16 +677,21 @@ int netlink_talk(int (*filter)(struct sockaddr_nl *, struct nlmsghdr *, ns_id_t,
 {
        int status;
        struct sockaddr_nl snl;
-       struct iovec iov = {.iov_base = (void *)n, .iov_len = n->nlmsg_len};
-       struct msghdr msg = {
-               .msg_name = (void *)&snl,
-               .msg_namelen = sizeof snl,
-               .msg_iov = &iov,
-               .msg_iovlen = 1,
-       };
+       struct iovec iov;
+       struct msghdr msg;
        int save_errno;
 
        memset(&snl, 0, sizeof snl);
+       memset(&iov, 0, sizeof iov);
+       memset(&msg, 0, sizeof msg);
+
+       iov.iov_base = n;
+       iov.iov_len = n->nlmsg_len;
+       msg.msg_name = (void *)&snl;
+       msg.msg_namelen = sizeof snl;
+       msg.msg_iov = &iov;
+       msg.msg_iovlen = 1;
+
        snl.nl_family = AF_NETLINK;
 
        n->nlmsg_seq = ++nl->seq;