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)
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Tue, 22 Jan 2019 14:22:05 +0000 (15:22 +0100)
commit414be6c1112f8fa5d444f902ca0061f631a46522
tree4b44083c79d6f3b52c18117540ad01d7b9ef6788
parentf50faf84081caa3ce325d2ec69f9dda2520174d9
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