On Mon, Jan 10, 2011 at 08:14:33AM -0500, jamal wrote:
Nice - short and sweet.
IMO: I dont think you need this new attribute, IFLA_GROUP
should suffice...
You can use the trick that if a <=0 ifindex is specified,
and no name is passed but a GROUP is passed, then we
operate on the group i.e something like:
if (ifm->ifi_index > 0)
dev = __dev_get_by_index(net, ifm->ifi_index);
else {
if (tb[IFLA_IFNAME])
dev = __dev_get_by_name(net, ifname);
else if (tb[IFLA_GROUP])
new/get/set/del specific stuff..
else
return -EINVAL;
}
That sounds like a good idea, but, by using the same attribute,
userspace won't be able to change the group of all the interfaces in a
group, i.e. no more
ip l set group 1 devgroup 0
However, I'm not sure that the use case above would be very common.
Vlad