aboutsummaryrefslogtreecommitdiffstats
path: root/main/quagga/musl-fix-msghdr-usage.patch
blob: 77ba1a3776a06651090f25a550a9cc3059502689 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
diff -ru quagga-0.99.23.orig/zebra/rt_netlink.c quagga-0.99.23/zebra/rt_netlink.c
--- quagga-0.99.23.orig/zebra/rt_netlink.c	2014-06-24 08:14:20.000000000 -0300
+++ quagga-0.99.23/zebra/rt_netlink.c	2014-07-29 11:20:47.188233069 -0300
@@ -282,9 +282,17 @@
   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 @@
 {
   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);