[systemd-commits] 2 commits - src/libsystemd src/network
Tom Gundersen
tomegun at kemper.freedesktop.org
Sun Feb 8 07:34:32 PST 2015
src/libsystemd/sd-rtnl/rtnl-message.c | 4 ----
src/network/networkd-link-bus.c | 5 +++--
2 files changed, 3 insertions(+), 6 deletions(-)
New commits:
commit 02f500532e4823584aae43cbe762914b4a0c0254
Author: Mantas Mikulėnas <grawity at gmail.com>
Date: Fri Feb 6 22:35:14 2015 +0200
networkd: use valid bus paths
Object path components must start with [A-Za-z_] (AFAIK).
Also the value of 'p' is undefined if asprintf fails.
Compare to user_bus_path() in src/login/logind-user-dbus.c:281.
diff --git a/src/network/networkd-link-bus.c b/src/network/networkd-link-bus.c
index f7eae87..7c4f473 100644
--- a/src/network/networkd-link-bus.c
+++ b/src/network/networkd-link-bus.c
@@ -43,7 +43,8 @@ static char *link_bus_path(Link *link) {
assert(link);
assert(link->ifindex > 0);
- asprintf(&p, "/org/freedesktop/network1/link/%d", link->ifindex);
+ if (asprintf(&p, "/org/freedesktop/network1/link/_%d", link->ifindex) < 0)
+ return NULL;
return p;
}
@@ -89,7 +90,7 @@ int link_object_find(sd_bus *bus, const char *path, const char *interface, void
assert(m);
assert(found);
- if (sscanf(path, "/org/freedesktop/network1/link/%d", &ifindex) != 1)
+ if (sscanf(path, "/org/freedesktop/network1/link/_%d", &ifindex) != 1)
return 0;
r = link_get(m, ifindex, &link);
commit b8719ebb57961f93a9aeeb49f0b9ba1f2bab7068
Author: Tom Gundersen <teg at jklm.no>
Date: Fri Feb 6 14:43:17 2015 +0100
sd-rtnl: don't treat 0-length messages specially
Still parse the CMSG data, and most importantly make sure we drop the message when peeking.
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index f072899..14a52df 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -1350,10 +1350,6 @@ static int socket_recv_message(int fd, struct iovec *iov, uint32_t *_group, bool
log_debug("rtnl: no data in socket");
return (errno == EAGAIN || errno == EINTR) ? 0 : -errno;
- } else if (r == 0) {
- /* connection was closed by the kernel? */
- log_warning("rtnl: ignoring empty message");
- return 0;
}
for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) {
More information about the systemd-commits
mailing list