/* Issue request message to kernel via netlink socket. GET messages
* are issued through this interface.
*/
-int netlink_request(struct nlsock *nl, struct nlmsghdr *n)
+int netlink_request(struct nlsock *nl, void *req)
{
int ret;
struct sockaddr_nl snl;
+ struct nlmsghdr *n = (struct nlmsghdr *)req;
/* Check netlink socket. */
if (nl->sock < 0) {
/* Raise capabilities and send message, then lower capabilities. */
frr_with_privs(&zserv_privs) {
- ret = sendto(nl->sock, (void *)n, n->nlmsg_len, 0,
+ ret = sendto(nl->sock, req, n->nlmsg_len, 0,
(struct sockaddr *)&snl, sizeof(snl));
}
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg));
req.rtm.rtm_family = family;
- return netlink_request(&zns->netlink_cmd, &req.n);
+ return netlink_request(&zns->netlink_cmd, &req);
}
/* Routing table read function using netlink interface. Only called
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct nhmsg));
req.nhm.nh_family = family;
- return netlink_request(&zns->netlink_cmd, &req.n);
+ return netlink_request(&zns->netlink_cmd, &req);
}
if (master_ifindex)
addattr32(&req.n, sizeof(req), IFLA_MASTER, master_ifindex);
- return netlink_request(netlink_cmd, &req.n);
+ return netlink_request(netlink_cmd, &req);
}
/*
vrf_id_to_name(br_if->vrf_id), br_if->vrf_id,
prefix_mac2str(mac, buf, sizeof(buf)), vid);
- return netlink_request(&zns->netlink_cmd, &req.n);
+ return netlink_request(&zns->netlink_cmd, &req);
}
int netlink_macfdb_read_specific_mac(struct zebra_ns *zns,
if (ifindex)
addattr32(&req.n, sizeof(req), NDA_IFINDEX, ifindex);
- return netlink_request(netlink_cmd, &req.n);
+ return netlink_request(netlink_cmd, &req);
}
/*
ipaddr2str(ip, buf, sizeof(buf)), req.n.nlmsg_flags);
}
- return netlink_request(&zns->netlink_cmd, &req.n);
+ return netlink_request(&zns->netlink_cmd, &req);
}
int netlink_neigh_read_specific_ip(struct ipaddr *ip,