Skip to content

ipv4: preserve devinet inheritance after unparsed writes

Yingjie Wang linux-kselftest lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2ipv4: devinet: update inheritance state only after parsed writesnet/ipv4/devinet.c+26 -32 replies
2/2selftests: net: test devinet inheritance after failed writestools/testing/selftests/net/Makefile tools/testing/selftests/net/devinet_conf.sh+102 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net 0/2] ipv4: preserve devinet inheritance after unparsed writes

devinet_conf_proc() currently marks per-device IPv4 settings as explicitly configured even when a sysctl write fails or is ignored before parsing a value. A later conf/default update then skips the device.

Patch 1 updates inheritance state and runs post-set handling only after successful integer conversion. Patch 2 adds a regression test for a failed write and the complementary valid same-value case. Before either case, the test verifies that lo still inherits conf/default, so inherited init_net state cannot turn the result into a false pass.

On the current net/main base, the failed-write selftest case fails while the same-value control passes. Both cases pass with this series. A separate eight-case VM test also covers invalid, blank, zero-byte and strict nonzero-offset writes plus valid-write controls.

Full x86-64 allyesconfig and allmodconfig builds with W=1 completed after disabling CONFIG_WERROR; the changed object produced no diagnostics. An i386 W=1 build of net/ipv4/devinet.o also passed.

checkpatch reports the expected CONST_STRUCT warning for the mutable call-local ctl_table copy in patch 1 and the generic MAINTAINERS prompt for the new selftest in patch 2. The copy carries per-call converter state, and tools/testing/selftests/net is already covered by NETWORKING [GENERAL].

Yingjie Wang (2):
ipv4: devinet: update inheritance state only after parsed writes
selftests: net: test devinet inheritance after failed writes

 net/ipv4/devinet.c                          |  29 +++++-
 tools/testing/selftests/net/Makefile        |   1 +
 tools/testing/selftests/net/devinet_conf.sh | 101 ++++++++++++++++++++
 3 files changed, 128 insertions(+), 3 deletions(-)
 create mode 100755 tools/testing/selftests/net/devinet_conf.sh

base-commit: fcc00b15cb21a6de76826e5012b2c758505f5e65

Signature · 1 line
2.43.0