You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.4 KiB

  1. From 0fc8dfa7ef479220b2a27901c5c69add6e13debd Mon Sep 17 00:00:00 2001
  2. From: Stijn Tintel <stijn@linux-ipv6.be>
  3. Date: Tue, 10 May 2016 04:26:31 +0300
  4. Subject: [PATCH] vrrp: update struct msghdr
  5. The vrrp netlink code assumes an order for the members of struct msghdr.
  6. This breaks recvmsg and sendmsg with musl libc on mips64. Fix this by
  7. using designated initializers instead.
  8. ---
  9. keepalived/vrrp/vrrp_netlink.c | 15 ++++++++++++---
  10. 1 file changed, 12 insertions(+), 3 deletions(-)
  11. --- a/keepalived/vrrp/vrrp_netlink.c
  12. +++ b/keepalived/vrrp/vrrp_netlink.c
  13. @@ -276,8 +276,12 @@ netlink_parse_info(int (*filter) (struct
  14. char buf[4096];
  15. struct iovec iov = { buf, sizeof buf };
  16. struct sockaddr_nl snl;
  17. - struct msghdr msg =
  18. - { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 };
  19. + struct msghdr msg = {
  20. + .msg_name = &snl,
  21. + .msg_namelen = sizeof(snl),
  22. + .msg_iov = &iov,
  23. + .msg_iovlen = 1,
  24. + };
  25. struct nlmsghdr *h;
  26. status = recvmsg(nl->fd, &msg, 0);
  27. @@ -386,7 +390,12 @@ netlink_talk(nl_handle_t *nl, struct nlm
  28. int ret, flags;
  29. struct sockaddr_nl snl;
  30. struct iovec iov = { (void *) n, n->nlmsg_len };
  31. - struct msghdr msg = { (void *) &snl, sizeof snl, &iov, 1, NULL, 0, 0 };
  32. + struct msghdr msg = {
  33. + .msg_name = &snl,
  34. + .msg_namelen = sizeof(snl),
  35. + .msg_iov = &iov,
  36. + .msg_iovlen = 1,
  37. + };
  38. memset(&snl, 0, sizeof snl);
  39. snl.nl_family = AF_NETLINK;