summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Leitner <fbl@sysclose.org>2019-03-26 14:14:59 -0300
committerBen Pfaff <blp@ovn.org>2019-04-16 15:48:50 -0700
commitb43762a5ad3343d28e61ed518c97802c5bd8f380 (patch)
tree9d215d7e7893f6dab50925392dcb5e8b703680a7
parent2aaeb6108a38068ffcc7a5f261e5a5e679f9bcf5 (diff)
downloadopenvswitch-b43762a5ad3343d28e61ed518c97802c5bd8f380.tar.gz
netlink linux: account for the netnsid netlink attr.
The buffer needs to be reallocated and data copied when the netnsid netlink attribute is included, so avoid that by accounting the attribute when the buffer is initially allocated. Fixes: 756819ddd788 ("netdev-linux: use netlink to update netdev.") Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Flavio Leitner <fbl@sysclose.org> Signed-off-by: Ben Pfaff <blp@ovn.org>
-rw-r--r--lib/netdev-linux.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c
index 776d938ee..7c0f51700 100644
--- a/lib/netdev-linux.c
+++ b/lib/netdev-linux.c
@@ -6047,8 +6047,8 @@ netdev_linux_update_via_netlink(struct netdev_linux *netdev)
ofpbuf_init(&request, 0);
nl_msg_put_nlmsghdr(&request,
- sizeof(struct ifinfomsg) + NL_ATTR_SIZE(IFNAMSIZ),
- RTM_GETLINK, NLM_F_REQUEST);
+ sizeof(struct ifinfomsg) + NL_ATTR_SIZE(IFNAMSIZ) +
+ NL_A_U32_SIZE, RTM_GETLINK, NLM_F_REQUEST);
ofpbuf_put_zeros(&request, sizeof(struct ifinfomsg));
/* The correct identifiers for a Linux device are netnsid and ifindex,