Bug 8261

Summary: vlan creation with proto option is not working
Product: Busybox Reporter: a.dibacco
Component: NetworkingAssignee: unassigned
Status: RESOLVED FIXED    
Severity: major CC: busybox-cvs, service
Priority: P2    
Version: 1.27.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

Description a.dibacco 2015-08-05 18:00:55 UTC
Try to issue the following command:

iplink add link eth0 eth0.24 type vlan proto 802.1ad id 24

It answers with:

argument of "protocol" must be "on" or "off"


I saw that in iplink.c in function vlan_parse_opt the keywords array and related enum are not consistent. ARG_protocol is listed at the end of enum and should be at the second place.

static void vlan_parse_opt(char **argv, struct nlmsghdr *n, unsigned int size)
{
	static const char keywords[] ALIGN1 =
		"id\0"
		"protocol\0"
		"reorder_hdr\0"
		"gvrp\0"
		"mvrp\0"
		"loose_binding\0"
	;

	enum {
		ARG_id = 0,
		ARG_reorder_hdr,
		ARG_gvrp,
		ARG_mvrp,
		ARG_loose_binding,
		ARG_protocol,
	};
Comment 1 a.dibacco 2015-08-05 21:07:55 UTC
Even if I correct the bug I highlighted in the Description, the command:

iplink add link eth0 eth0.24 type vlan proto 802.1ad id 24

still fails with:

RTNETLINK answers: Protocol not supported

I believe that the proto field (ETH_P_8021Q or ETH_P_8021AD) added as an attribute to the netlink message should be in network order. 

I fixed this bug too and it seems to work. Still testing anyway.
Comment 2 Vladimir B. 2017-08-26 18:34:27 UTC
Hi.

I've got the same issue with BusyBox 1.27.2. - 

argument of "protocol" must be "on" or "off"

Upon this it is impossible to setup 802.1ad in OpenWRT.

I'm so close to C++ to resolve this issue by myself. Anyone can help with it?
Comment 3 Vladimir B. 2017-08-29 12:12:36 UTC
LEDE project uses busybox-1.26. In latest busybox-1.27.2 reported above bug fixed. IP commands works fine for 802.1ad and 802.1q vlan's as for me.