Hide Forgot
Description of problem: sysctl return 0 even fail to set value Version-Release number of selected component (if applicable): procps-ng-3.3.10-10.el7.x86_64 How reproducible: Always Steps to Reproduce: 1. sysctl -w net.ipv4.ip_default_ttl=0 2. check return value Actual results: return value is 0 Expected results: return value should be 255 Additional info: [root@ibm-x3650m5-03 proc_sys_net_ipv4]# uname -a Linux ibm-x3650m5-03.rhts.eng.pek2.redhat.com 3.10.0-514.el7.x86_64 #1 SMP Wed Oct 19 11:24:13 EDT 2016 x86_64 x86_64 x86_64 GNU/Linux [root@ibm-x3650m5-03 proc_sys_net_ipv4]# rpm -qa | grep procps procps-ng-3.3.10-10.el7.x86_64 [root@ibm-x3650m5-03 proc_sys_net_ipv4]# sysctl -w net.ipv4.ip_default_ttl=0 sysctl: setting key "net.ipv4.ip_default_ttl": Invalid argument net.ipv4.ip_default_ttl = 0 [root@ibm-x3650m5-03 proc_sys_net_ipv4]# echo $? 0 [root@ibm-x3650m5-03 proc_sys_net_ipv4]# sysctl net.ipv4.ip_default_ttl net.ipv4.ip_default_ttl = 64
(In reply to Jianlin Shi from comment #0) > Steps to Reproduce: > 1. sysctl -w net.ipv4.ip_default_ttl=0 > 2. check return value > > Actual results: > return value is 0 This looks incorrect indeed. The exit code should be non-zero if sysctl failed to write the value. > Expected results: > return value should be 255 Why do you think that exactly 255 should be returned?
(In reply to Kamil Dudka from comment #1) > (In reply to Jianlin Shi from comment #0) > > Steps to Reproduce: > > 1. sysctl -w net.ipv4.ip_default_ttl=0 > > 2. check return value > > > > Actual results: > > return value is 0 > > This looks incorrect indeed. The exit code should be non-zero if sysctl > failed to write the value. > > > Expected results: > > return value should be 255 > > Why do you think that exactly 255 should be returned? program normally return 255 if the error is "Invalid argument". BTW, sysctl return 255 on rhel6.
Issue reproduced and will be investigated. Thank you for your report.
Looks like duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=1264080 Closing as DUPLICATE *** This bug has been marked as a duplicate of bug 1264080 ***