40 lines
1.9 KiB
Diff
40 lines
1.9 KiB
Diff
diff -Naur systemd-210/src/libsystemd/sd-rtnl/rtnl-message.c systemd-210.mod/src/libsystemd/sd-rtnl/rtnl-message.c
|
|
--- systemd-210/src/libsystemd/sd-rtnl/rtnl-message.c 2014-11-19 13:10:23.998310815 +0100
|
|
+++ systemd-210.mod/src/libsystemd/sd-rtnl/rtnl-message.c 2014-12-08 12:03:18.059734333 +0100
|
|
@@ -722,6 +722,7 @@
|
|
|
|
int sd_rtnl_message_open_container(sd_rtnl_message *m, unsigned short type) {
|
|
uint16_t rtm_type;
|
|
+ int r;
|
|
|
|
assert_return(m, -EINVAL);
|
|
assert_return(!m->sealed, -EPERM);
|
|
@@ -729,15 +730,21 @@
|
|
sd_rtnl_message_get_type(m, &rtm_type);
|
|
|
|
if (rtnl_message_type_is_link(rtm_type)) {
|
|
-
|
|
if ((type == IFLA_LINKINFO && m->n_containers == 0) ||
|
|
(type == IFLA_INFO_DATA && m->n_containers == 1 &&
|
|
- GET_CONTAINER(m, 0)->rta_type == IFLA_LINKINFO))
|
|
- return add_rtattr(m, type, NULL, 0);
|
|
- else if (type == VETH_INFO_PEER && m->n_containers == 2 &&
|
|
+ GET_CONTAINER(m, 0)->rta_type == IFLA_LINKINFO)) {
|
|
+ r = add_rtattr(m, type, NULL, 0);
|
|
+ if ( r > 0)
|
|
+ m->container_offsets[m->n_containers ++] = r;
|
|
+ return r;
|
|
+ } else if (type == VETH_INFO_PEER && m->n_containers == 2 &&
|
|
GET_CONTAINER(m, 1)->rta_type == IFLA_INFO_DATA &&
|
|
- GET_CONTAINER(m, 0)->rta_type == IFLA_LINKINFO)
|
|
- return add_rtattr(m, type, NULL, sizeof(struct ifinfomsg));
|
|
+ GET_CONTAINER(m, 0)->rta_type == IFLA_LINKINFO) {
|
|
+ r = add_rtattr(m, type, NULL, sizeof(struct ifinfomsg));
|
|
+ if ( r > 0)
|
|
+ m->container_offsets[m->n_containers ++] = r;
|
|
+ return r;
|
|
+ }
|
|
}
|
|
|
|
return -ENOTSUP;
|