chiark / gitweb /
sd-rtnl: route - allow GETROUTE with AF_UNSPEC
authorTom Gundersen <teg@jklm.no>
Tue, 2 Dec 2014 09:46:14 +0000 (10:46 +0100)
committerTom Gundersen <teg@jklm.no>
Tue, 2 Dec 2014 09:46:22 +0000 (10:46 +0100)
src/libsystemd/sd-rtnl/rtnl-message.c

index 84ebf65..7ec6143 100644 (file)
@@ -150,7 +150,8 @@ int sd_rtnl_message_new_route(sd_rtnl *rtnl, sd_rtnl_message **ret,
         int r;
 
         assert_return(rtnl_message_type_is_route(nlmsg_type), -EINVAL);
-        assert_return(rtm_family == AF_INET || rtm_family == AF_INET6, -EINVAL);
+        assert_return((nlmsg_type == RTM_GETROUTE && rtm_family == AF_UNSPEC) ||
+                      rtm_family == AF_INET || rtm_family == AF_INET6, -EINVAL);
         assert_return(ret, -EINVAL);
 
         r = message_new(rtnl, ret, nlmsg_type);