mbox series

[v3,net-next,0/4] rtnetlink: improve ALT_IFNAME config and fix dangerous GROUP usage

Message ID 20220407122559.27515-1-florent.fourcot@wifirst.fr (mailing list archive)
Headers show
Series rtnetlink: improve ALT_IFNAME config and fix dangerous GROUP usage | expand

Message

Florent Fourcot April 7, 2022, 12:25 p.m. UTC
The primary goal of this patchset is to fix/improve IFLA_ALT_IFNAME
attribute, since previous code was never working for newlink/setlink.
ip-link command is probably getting interface index before, and was not
using this feature.

Third commit forbids dangerous calls when both IFNAME and GROUP are
given, since it can introduce unexpected behaviour when IFNAME does not
match any interface.

Changes in v2:
  * Remove ifname argument in rtnl_dev_get/do_setlink
    functions (simplify code)
  * Use a boolean to avoid condition duplication in __rtnl_newlink

Changes in v3:
  * Simplify rtnl_dev_get signature

Changes in v4:
  * Rename link_lookup to link_specified


Florent Fourcot (4):
  rtnetlink: enable alt_ifname for setlink/newlink
  rtnetlink: return ENODEV when IFLA_ALT_IFNAME is used in dellink
  rtnetlink: return ENODEV when ifname does not exist and group is given
  rtnetlink: return EINVAL when request cannot succeed

 net/core/rtnetlink.c | 91 ++++++++++++++++++++++----------------------
 1 file changed, 45 insertions(+), 46 deletions(-)