summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-rtnl
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-14 12:42:11 +0200
committerTom Gundersen <teg@jklm.no>2014-04-14 17:53:21 +0200
commitb9ef681b04644493fca7c1d5611db7169697d26a (patch)
tree0386b4e1899f14e496853730313b6596ec22b19f /src/libsystemd/sd-rtnl
parenta88f77c406ea56160c1e5a4b39eab1de134abe40 (diff)
sd-rtnl: message_addr - allow dumping of messages
Diffstat (limited to 'src/libsystemd/sd-rtnl')
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index a93cb0c8e4..1afba8f0bb 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -326,15 +326,17 @@ int sd_rtnl_message_new_addr(sd_rtnl *rtnl, sd_rtnl_message **ret,
int r;
assert_return(rtnl_message_type_is_addr(nlmsg_type), -EINVAL);
- assert_return(index > 0, -EINVAL);
- assert_return(family == AF_INET || family == AF_INET6, -EINVAL);
+ assert_return((nlmsg_type == RTM_GETADDR && index == 0) ||
+ index > 0, -EINVAL);
+ assert_return((nlmsg_type == RTM_GETADDR && family == AF_UNSPEC) ||
+ family == AF_INET || family == AF_INET6, -EINVAL);
assert_return(ret, -EINVAL);
r = message_new(rtnl, ret, nlmsg_type);
if (r < 0)
return r;
- if (nlmsg_type == RTM_GETADDR && family == AF_INET)
+ if (nlmsg_type == RTM_GETADDR)
(*ret)->hdr->nlmsg_flags |= NLM_F_DUMP;
ifa = NLMSG_DATA((*ret)->hdr);