summaryrefslogtreecommitdiff
path: root/sysdep/linux
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2015-07-28 12:35:12 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2015-07-28 12:36:03 +0200
commit641172c6e5e4e291029084074f94f448d6bc69dd (patch)
tree9d4ddc386b5430d9b04ce775bfe11e5e4ee82758 /sysdep/linux
parent538264cf1a7690d90b2953aebff21958c2b55c44 (diff)
Netlink: Fixes uninitialized variable
Thanks to Pavel Tvrdik for the bugfix
Diffstat (limited to 'sysdep/linux')
-rw-r--r--sysdep/linux/netlink.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index 9f206e1c..9c9449e2 100644
--- a/sysdep/linux/netlink.c
+++ b/sysdep/linux/netlink.c
@@ -100,11 +100,12 @@ nl_request_dump(int af, int cmd)
struct {
struct nlmsghdr nh;
struct rtgenmsg g;
- } req;
- req.nh.nlmsg_type = cmd;
- req.nh.nlmsg_len = sizeof(req);
- req.nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP;
- req.g.rtgen_family = af;
+ } req = {
+ .nh.nlmsg_type = cmd,
+ .nh.nlmsg_len = sizeof(req),
+ .nh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP,
+ .g.rtgen_family = af
+ };
nl_send(&nl_scan, &req.nh);
}