diff options
Diffstat (limited to 'sysdep/linux')
-rw-r--r-- | sysdep/linux/netlink.c | 2 | ||||
-rw-r--r-- | sysdep/linux/sysio.h | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c index a0f85186..132403af 100644 --- a/sysdep/linux/netlink.c +++ b/sysdep/linux/netlink.c @@ -151,7 +151,7 @@ nl_get_reply(struct nl_sock *nl) } } -static struct rate_limit rl_netlink_err; +static struct tbf rl_netlink_err = TBF_DEFAULT_LOG_LIMITS; static int nl_error(struct nlmsghdr *h) diff --git a/sysdep/linux/sysio.h b/sysdep/linux/sysio.h index 5fd75c90..c1561cbf 100644 --- a/sysdep/linux/sysio.h +++ b/sysdep/linux/sysio.h @@ -154,6 +154,7 @@ sk_prepare_cmsgs4(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen) { struct cmsghdr *cm; struct in_pktinfo *pi; + int controllen = 0; msg->msg_control = cbuf; msg->msg_controllen = cbuflen; @@ -162,13 +163,14 @@ sk_prepare_cmsgs4(sock *s, struct msghdr *msg, void *cbuf, size_t cbuflen) cm->cmsg_level = SOL_IP; cm->cmsg_type = IP_PKTINFO; cm->cmsg_len = CMSG_LEN(sizeof(*pi)); + controllen += CMSG_SPACE(sizeof(*pi)); pi = (struct in_pktinfo *) CMSG_DATA(cm); pi->ipi_ifindex = s->iface ? s->iface->index : 0; pi->ipi_spec_dst = ipa_to_in4(s->saddr); pi->ipi_addr = ipa_to_in4(IPA_NONE); - msg->msg_controllen = cm->cmsg_len; + msg->msg_controllen = controllen; } |