Subject: [PATCH 2/2] Handle netdev group for veth peer too

From: Sergey Popovich <[email-masked]>
Date: Wed, 11 Dec 2013 14:25:07 +0200

Currently ip-link(8) parses, but ignores "group" argument to
peer interface on veth creation.

Insert IFLA_GROUP attribute for peer interface when present.

Signed-off-by: Sergey Popovich <[email-masked]>
---
 ip/link_veth.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/ip/link_veth.c b/ip/link_veth.c
index 7730f39..98ff6a5 100644
--- a/ip/link_veth.c
+++ b/ip/link_veth.c
@@ -53,6 +53,9 @@ static int veth_parse_opt(struct link_util *lu, int argc, char **argv,
 		addattr_l(hdr, 1024, IFLA_IFNAME, name, len);
 	}
 
+	if (group != -1)
+		addattr32(hdr, 1024, IFLA_GROUP, group);
+
 	data->rta_len = (void *)NLMSG_TAIL(hdr) - (void *)data;
 	return argc - 1 - err;
 }
-- 
1.7.10.4