]> git.proxmox.com Git - mirror_frr.git/blobdiff - zebra/kernel_netlink.c
Merge pull request #5706 from mjstapp/fix_nh_debug_show
[mirror_frr.git] / zebra / kernel_netlink.c
index ed749089a4f422a50938ff17cae65f41e7a4e940..90d3aeb482d9c4fe8b912380acf911b916c7ed10 100644 (file)
@@ -592,6 +592,7 @@ struct rtattr *addattr_nest(struct nlmsghdr *n, int maxlen, int type)
        struct rtattr *nest = NLMSG_TAIL(n);
 
        addattr_l(n, maxlen, type, NULL, 0);
+       nest->rta_type |= NLA_F_NESTED;
        return nest;
 }
 
@@ -606,6 +607,7 @@ struct rtattr *rta_nest(struct rtattr *rta, int maxlen, int type)
        struct rtattr *nest = RTA_TAIL(rta);
 
        rta_addattr_l(rta, maxlen, type, NULL, 0);
+       nest->rta_type |= NLA_F_NESTED;
        return nest;
 }
 
@@ -1098,7 +1100,7 @@ int netlink_request(struct nlsock *nl, struct nlmsghdr *n)
    netlink_socket (). */
 void kernel_init(struct zebra_ns *zns)
 {
-       unsigned long groups;
+       uint32_t groups;
 #if defined SOL_NETLINK
        int one, ret;
 #endif
@@ -1119,9 +1121,9 @@ void kernel_init(struct zebra_ns *zns)
                RTMGRP_IPV6_IFADDR             |
                RTMGRP_IPV4_MROUTE             |
                RTMGRP_NEIGH                   |
-               (1 << (RTNLGRP_IPV4_RULE - 1)) |
-               (1 << (RTNLGRP_IPV6_RULE - 1)) |
-               (1 << (RTNLGRP_NEXTHOP - 1));
+               ((uint32_t) 1 << (RTNLGRP_IPV4_RULE - 1)) |
+               ((uint32_t) 1 << (RTNLGRP_IPV6_RULE - 1)) |
+               ((uint32_t) 1 << (RTNLGRP_NEXTHOP - 1));
 
        snprintf(zns->netlink.name, sizeof(zns->netlink.name),
                 "netlink-listen (NS %u)", zns->ns_id);