diff options
author | Tom Gundersen <teg@jklm.no> | 2014-12-08 19:54:06 +0100 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2014-12-08 22:13:40 +0100 |
commit | 45af44d47da6933b260c734ad9ff721f63f80a4d (patch) | |
tree | 0aae958af8aba2c93a202b9e681749cfc9e19b66 /src/libsystemd/sd-rtnl | |
parent | 2173cbf847fc53ca24950e77958c902edecfc207 (diff) |
networkd: manager - enumerate addresses globally, rather than per-link
The kernel always returns all addresses, rather than only for the given link, so let's only enumerate once.
Diffstat (limited to 'src/libsystemd/sd-rtnl')
-rw-r--r-- | src/libsystemd/sd-rtnl/rtnl-message.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c index ac920b2d30..5c627f96ab 100644 --- a/src/libsystemd/sd-rtnl/rtnl-message.c +++ b/src/libsystemd/sd-rtnl/rtnl-message.c @@ -1194,13 +1194,20 @@ uint32_t rtnl_message_get_serial(sd_rtnl_message *m) { return m->hdr->nlmsg_seq; } +int sd_rtnl_message_is_error(sd_rtnl_message *m) { + assert_return(m, 0); + assert_return(m->hdr, 0); + + return m->hdr->nlmsg_type == NLMSG_ERROR; +} + int sd_rtnl_message_get_errno(sd_rtnl_message *m) { struct nlmsgerr *err; assert_return(m, -EINVAL); assert_return(m->hdr, -EINVAL); - if (m->hdr->nlmsg_type != NLMSG_ERROR) + if (!sd_rtnl_message_is_error(m)) return 0; err = NLMSG_DATA(m->hdr); |