]> git.baikalelectronics.ru Git - kernel.git/commit
net: bridge: Allow base 16 inputs in sysfs
authorIdo Schimmel <idosch@nvidia.com>
Wed, 24 Nov 2021 10:11:22 +0000 (12:11 +0200)
committerJakub Kicinski <kuba@kernel.org>
Thu, 25 Nov 2021 01:23:52 +0000 (17:23 -0800)
commita44d9eb174dea0aee117e45b30fcdf63af9f7856
tree988924d2992a6e646f89c8c6efdbdfc53f75eef6
parent62407deabf51c765da19a4070b99b9be71c4ba3f
net: bridge: Allow base 16 inputs in sysfs

Cited commit converted simple_strtoul() to kstrtoul() as suggested by
the former's documentation. However, it also forced all the inputs to be
decimal resulting in user space breakage.

Fix by setting the base to '0' so that the base is automatically
detected.

Before:

 # ip link add name br0 type bridge vlan_filtering 1
 # echo "0x88a8" > /sys/class/net/br0/bridge/vlan_protocol
 bash: echo: write error: Invalid argument

After:

 # ip link add name br0 type bridge vlan_filtering 1
 # echo "0x88a8" > /sys/class/net/br0/bridge/vlan_protocol
 # echo $?
 0

Fixes: f03c74564a6e ("net/bridge: replace simple_strtoul to kstrtol")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com>
Link: https://lore.kernel.org/r/20211124101122.3321496-1-idosch@idosch.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/bridge/br_sysfs_br.c