Cong Wang
856c395cfa
net: introduce a knob to control whether to inherit devconf config
...
There have been many people complaining about the inconsistent
behaviors of IPv4 and IPv6 devconf when creating new network
namespaces. Currently, for IPv4, we inherit all current settings
from init_net, but for IPv6 we reset all setting to default.
This patch introduces a new /proc file
/proc/sys/net/core/devconf_inherit_init_net to control the
behavior of whether to inhert sysctl current settings from init_net.
This file itself is only available in init_net.
As demonstrated below:
Initial setup in init_net:
# cat /proc/sys/net/ipv4/conf/all/rp_filter
2
# cat /proc/sys/net/ipv6/conf/all/accept_dad
1
Default value 0 (current behavior):
# ip netns del test
# ip netns add test
# ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
2
# ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
0
Set to 1 (inherit from init_net):
# echo 1 > /proc/sys/net/core/devconf_inherit_init_net
# ip netns del test
# ip netns add test
# ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
2
# ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
1
Set to 2 (reset to default):
# echo 2 > /proc/sys/net/core/devconf_inherit_init_net
# ip netns del test
# ip netns add test
# ip netns exec test cat /proc/sys/net/ipv4/conf/all/rp_filter
0
# ip netns exec test cat /proc/sys/net/ipv6/conf/all/accept_dad
0
Set to a value out of range (invalid):
# echo 3 > /proc/sys/net/core/devconf_inherit_init_net
-bash: echo: write error: Invalid argument
# echo -1 > /proc/sys/net/core/devconf_inherit_init_net
-bash: echo: write error: Invalid argument
Reported-by: Zhu Yanjun <[email protected] >
Reported-by: Tonghao Zhang <[email protected] >
Cc: Nicolas Dichtel <[email protected] >
Signed-off-by: Cong Wang <[email protected] >
Acked-by: Nicolas Dichtel <[email protected] >
Acked-by: Tonghao Zhang <[email protected] >
Signed-off-by: David S. Miller <[email protected] >
2019-01-22 11:07:21 -08:00
..
ABI
for-linus-20190112
2019-01-12 13:40:51 -08:00
accelerators
accounting
psi: cgroup support
2018-10-26 16:26:32 -07:00
acpi
admin-guide
A handful of late-arriving documentation fixes.
2019-01-05 18:35:02 -08:00
aoe
arm
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
arm64
arm64 festive updates for 4.21
2018-12-25 17:41:56 -08:00
auxdisplay
backlight
block
block: doc: add slice_idle_us to bfq documentation
2019-01-09 07:38:48 -07:00
blockdev
zram: idle writeback fixes and cleanup
2019-01-08 17:15:10 -08:00
bpf
bpf, doc: update design qa to reflect kern_version requirement
2019-01-07 15:52:00 -08:00
bus-devices
cdrom
cgroup-v1
Merge branch 'for-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
2018-10-25 17:15:46 -07:00
cma
connector
console
core-api
A handful of late-arriving documentation fixes.
2019-01-05 18:35:02 -08:00
cpu-freq
Documentation: cpu-freq: Frequencies aren't always sorted
2018-11-07 13:29:04 +01:00
cpuidle
Documentation: admin-guide: PM: Add cpuidle document
2018-12-03 10:03:36 +01:00
crypto
crypto: skcipher - remove remnants of internal IV generators
2018-12-23 11:52:45 +08:00
dev-tools
A fairly normal cycle for documentation stuff. We have a new
2018-12-29 11:21:49 -08:00
device-mapper
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
devicetree
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2019-01-21 14:41:32 -08:00
doc-guide
doc:process: add links where missing
2018-12-06 10:21:19 -07:00
driver-api
pci-v4.21-changes
2019-01-05 17:57:34 -08:00
driver-model
Documentation: driver core: remove use of BUS_ATTR
2019-01-08 15:17:45 +01:00
early-userspace
Correct gen_init_cpio tool's documentation
2018-11-25 12:25:53 -07:00
EDID
Docs/EDID: Calculate CRC while building the code
2018-11-06 07:36:22 -07:00
extcon
fault-injection
fb
fbdev: fbmem: convert CONFIG_FB_LOGO_CENTER into a cmd line option
2019-01-16 17:42:35 +01:00
features
Documentation/features: Add csky kernel features
2019-01-07 22:22:16 +08:00
filesystems
Documentation: driver core: remove use of BUS_ATTR
2019-01-08 15:17:45 +01:00
firmware_class
fmc
fpga
gpio
gpu
A fairly normal cycle for documentation stuff. We have a new
2018-12-29 11:21:49 -08:00
hid
HID: doc: fix wrong data structure reference for UHID_OUTPUT
2018-12-18 14:55:22 +01:00
hwmon
hwmon: Introduce SENSOR_DEVICE_ATTR_{RO, RW, WO} and variants
2018-12-16 15:13:22 -08:00
i2c
i2c: add i2c bus driver for NVIDIA GPU
2018-11-09 17:46:43 +01:00
ia64
ide
iio
infiniband
input
Input: add REL_WHEEL_HI_RES and REL_HWHEEL_HI_RES
2018-12-07 16:27:11 +01:00
ioctl
seccomp: add a return code to trap to userspace
2018-12-11 16:28:41 -08:00
isdn
kbuild
kbuild: generate asm-generic wrappers if mandatory headers are missing
2019-01-06 09:46:51 +09:00
kdump
kernel-hacking
laptops
platform-drivers-x86 for v4.20-1
2018-11-01 08:42:21 -07:00
leds
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
lightnvm
livepatch
locking
This is a fairly typical cycle for documentation. There's some welcome
2018-10-24 18:01:11 +01:00
m68k
maintainer
md
media
A fairly normal cycle for documentation stuff. We have a new
2018-12-29 11:21:49 -08:00
memory-devices
mic
mips
misc-devices
mmc
mtd
namespaces
netlabel
networking
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2019-01-21 14:41:32 -08:00
nfc
nios2
nvdimm
libnvdimm/security: Add documentation for nvdimm security support
2018-12-21 12:44:41 -08:00
nvmem
openrisc
parisc
PCI
pci-v4.20-changes
2018-10-25 06:50:48 -07:00
pcmcia
perf
Documentation: perf: Add documentation for ThunderX2 PMU uncore driver
2018-12-06 12:29:47 +00:00
phy
platform
power
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
powerpc
powerpc/fadump: Reservationless firmware assisted dump
2018-12-21 11:32:49 +11:00
pps
process
docs: fix Co-Developed-by docs
2019-01-04 13:13:48 -08:00
pti
ptp
rapidio
RCU
doc: Fix "struction" typo in RCU memory-ordering documentation
2018-11-12 08:56:25 -08:00
riscv
s390
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
scheduler
This is a fairly typical cycle for documentation. There's some welcome
2018-10-24 18:01:11 +01:00
scsi
SCSI misc on 20181224
2018-12-28 14:48:06 -08:00
security
Merge branch 'next-integrity' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
2019-01-02 09:43:14 -08:00
serial
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
sh
sh: remove board_time_init() callback
2018-12-18 16:13:04 +01:00
sound
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
sparc
sphinx
sphinx-static
spi
sysctl
net: introduce a knob to control whether to inherit devconf config
2019-01-22 11:07:21 -08:00
target
thermal
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
timers
trace
Merge branches 'pm-cpuidle', 'pm-cpufreq' and 'pm-sleep'
2019-01-11 10:09:51 +01:00
translations
doc 🇮🇹 add some process/* translations
2018-12-06 10:11:40 -07:00
usb
Documentation/usb: Fix typo
2018-11-26 16:56:34 +01:00
userspace-api
Merge branch 'next-seccomp' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security
2019-01-02 09:48:13 -08:00
virtual
Documentation/virtual/kvm: Update URL for AMD SEV API specification
2019-01-11 18:38:07 +01:00
vm
A fairly normal cycle for documentation stuff. We have a new
2018-12-29 11:21:49 -08:00
w1
watchdog
watchdog: docs: kernel-api: don't reference removed functions
2018-12-24 13:15:06 +01:00
wimax
x86
x86/cache: Rename config option to CONFIG_X86_RESCTRL
2019-01-09 10:29:03 +01:00
xilinx
xtensa
.gitignore
atomic_bitops.txt
atomic_t.txt
bt8xxgpio.txt
btmrvl.txt
bus-virt-phys-mapping.txt
Changes
clearing-warn-once.txt
CodingStyle
conf.py
This is a fairly typical cycle for documentation. There's some welcome
2018-10-24 18:01:11 +01:00
cpu-load.txt
cputopology.txt
crc32.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
digsig.txt
DMA-API-HOWTO.txt
DMA-API.txt
dma-mapping: deprecate dma_zalloc_coherent
2018-12-20 08:14:09 +01:00
DMA-attributes.txt
DMA-ISA-LPC.txt
docutils.conf
dontdiff
efi-stub.txt
eisa.txt
flexible-arrays.txt
futex-requeue-pi.txt
gcc-plugins.txt
highuid.txt
hw_random.txt
hwspinlock.txt
index.rst
Intel-IOMMU.txt
intel_txt.txt
io-mapping.txt
io_ordering.txt
iostats.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
irqflags-tracing.txt
isa.txt
isapnp.txt
kernel-per-CPU-kthreads.txt
kobject.txt
kref/kobject: Improve documentation
2018-12-06 13:57:03 +01:00
kprobes.txt
kref.txt
ldm.txt
lockup-watchdogs.txt
logo.gif
logo.txt
lsm.txt
lzo.txt
mailbox.txt
Makefile
kbuild: Add support for DT binding schema checks
2018-12-13 09:41:32 -06:00
memory-barriers.txt
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
men-chameleon-bus.txt
nommu-mmap.txt
ntb.txt
numastat.txt
padata.txt
parport-lowlevel.txt
percpu-rw-semaphore.txt
phy.txt
pi-futex.txt
pnp.txt
preempt-locking.txt
pwm.txt
rbtree.txt
remoteproc.txt
rfkill.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt
rtc.txt
SAK.txt
sgi-ioc4.txt
siphash.txt
SM501.txt
smsc_ece1099.txt
speculation.txt
static-keys.txt
Documentation: Use "while" instead of "whilst"
2018-11-20 09:30:43 -07:00
SubmittingPatches
svga.txt
switchtec.txt
sync_file.txt
tee.txt
this_cpu_ops.txt
unaligned-memory-access.txt
vfio-mediated-device.txt
vfio.txt
video-output.txt
xillybus.txt
xz.txt
zorro.txt