ip link: Fix vlan proto, closes 8261 and 11638
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 22 Jan 2019 10:11:15 +0000 (11:11 +0100)
committerDenys Vlasenko <vda.linux@googlemail.com>
Thu, 14 Feb 2019 13:40:57 +0000 (14:40 +0100)
commit8296334c1f457c598e04e1aa0f79cbdbbba27427
tree79460da8303b6ca8da9ccf49dc1d93543447d400
parent7f8f20714aefd4d6c7eaf7da941cdef743983521
ip link: Fix vlan proto, closes 8261 and 11638

The proto has to be passed in network byte-order.
While at it allow for
 ip link add link eth0 name eth0.2.24 type vlan proto 802.1ad id 24
 ip link del link eth0 name eth0.2.24 type vlan proto 802.1ad id 24
The del was lacking a dev_str and thus errored out. Fix by using
name/dev counterpart as fallback.

The proto identifier 802.1Q was not recognized, just it's lowercase
variant, fix that too.

function                                             old     new   delta
do_add_or_delete                                    1275    1376    +101
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/0 up/down: 101/0)             Total: 101 bytes

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
networking/libiproute/iplink.c