[PATCH net 0/2] ipv4: preserve devinet inheritance after unparsed writes
From: Yingjie Wang
Date: Thu Oct 29 2026 - 10:41:14 EST
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
--
2.43.0