diff options
| author | David Lamparter <equinox@opensourcerouting.org> | 2014-08-19 18:15:40 +0200 |
|---|---|---|
| committer | David Lamparter <equinox@opensourcerouting.org> | 2014-08-19 18:15:40 +0200 |
| commit | 1520e4748129c4eb97ac3090bcc97149a1900611 (patch) | |
| tree | f4501a77bcb9e3ecabfd9dd5f80ee3e71cb35119 /zebra/rt_netlink.c | |
| parent | 342a31bfda21616209366679ac522471e5772a2f (diff) | |
| parent | 90444ca35e3037ed43ec695428f0ef6d82f9a320 (diff) | |
*: merge branch stable/0.99.23
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'zebra/rt_netlink.c')
| -rw-r--r-- | zebra/rt_netlink.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 452ea64218..95a82fd2e4 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -282,9 +282,17 @@ netlink_parse_info (int (*filter) (struct sockaddr_nl *, struct nlmsghdr *), while (1) { char buf[NL_PKT_BUF_SIZE]; - struct iovec iov = { buf, sizeof buf }; + struct iovec iov = { + .iov_base = buf, + .iov_len = sizeof buf + }; struct sockaddr_nl snl; - struct msghdr msg = { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 }; + struct msghdr msg = { + .msg_name = (void *) &snl, + .msg_namelen = sizeof snl, + .msg_iov = &iov, + .msg_iovlen = 1 + }; struct nlmsghdr *h; status = recvmsg (nl->sock, &msg, 0); @@ -1312,8 +1320,16 @@ netlink_talk (struct nlmsghdr *n, struct nlsock *nl) { int status; struct sockaddr_nl snl; - struct iovec iov = { (void *) n, n->nlmsg_len }; - struct msghdr msg = { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 }; + 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, + }; int save_errno; memset (&snl, 0, sizeof snl); |
