OSDN Git Service

xfrm: interface with if_id 0 should return error
authorAntony Antony <antony.antony@secunet.com>
Sun, 12 Dec 2021 10:34:30 +0000 (11:34 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Fri, 17 Dec 2021 06:17:13 +0000 (07:17 +0100)
commit8dce43919566f06e865f7e8949f5c10d8c2493f5
tree9808ca8a9a52b77aa611d0c6a7e51d51da3e1852
parent7770a39d7c63faec6c4f33666d49a8cb664d0482
xfrm: interface with if_id 0 should return error

xfrm interface if_id = 0 would cause xfrm policy lookup errors since
Commit 9f8550e4bd9d.

Now explicitly fail to create an xfrm interface when if_id = 0

With this commit:
 ip link add ipsec0  type xfrm dev lo  if_id 0
 Error: if_id must be non zero.

v1->v2 change:
 - add Fixes: tag

Fixes: 9f8550e4bd9d ("xfrm: fix disable_xfrm sysctl when used on xfrm interfaces")
Signed-off-by: Antony Antony <antony.antony@secunet.com>
Reviewed-by: Eyal Birger <eyal.birger@gmail.com>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
net/xfrm/xfrm_interface.c