ipvlan: don't check for valid @mode argument in rtnl_link_ipvlan_set_mode()

In the future kernel might support more modes. Don't be so
strict in rtnl_link_ipvlan_set_mode() and accept any uint16
mode.
This way when adding new modes, rtnl_link_ipvlan_set_mode() does not
need to be changed.

If the user passes an invalid value and sends a message to the kernel,
it will be rejected there.

http://lists.infradead.org/pipermail/libnl/2015-June/001902.html

Fixes: 7de5be85bf

Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Thomas Haller 2015-06-26 18:01:21 +02:00
parent b4afcadc30
commit 371226b834

View file

@ -215,9 +215,6 @@ int rtnl_link_ipvlan_set_mode(struct rtnl_link *link, uint16_t mode)
IS_IPVLAN_LINK_ASSERT(link);
if (mode != IPVLAN_MODE_L2 && mode != IPVLAN_MODE_L3)
return -NLE_INVAL;
ipi->ipi_mode = mode;
ipi->ipi_mask |= IPVLAN_HAS_MODE;