linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: sysctl, argument parsing, possible bug
@ 2017-08-08 18:26 Massimo Sala
  2017-08-08 19:04 ` Stephen Hemminger
  0 siblings, 1 reply; 8+ messages in thread
From: Massimo Sala @ 2017-08-08 18:26 UTC (permalink / raw)
  To: LKML, Linux Kernel Network Developers

I make another test with kernel 4.9.32-15.41

sysctl procps version 3.2.8

    sysctl net.ipv4.conf.eth0.100.forwarding
    error: "net.ipv4.conf.eth0.100.forwarding" is an unknown key


so I install busybox :

BusyBox v1.19.3

    busybox sysctl net.ipv4.conf.eth0.100.forwarding
    net.ipv4.conf.eth0.100.forwarding = 0

It is working, as I expect reading busybox source sysctl.c



Stephen, I test
    sysctl net/ipv4/conf/eth0.100/forwarding
I confirm it  works.


What is the problem ?

As sysctl, also automation tools and scripts cannot be "netdev names
aware", and so they fail using the usual dot notation.


I don't pretend to change sysctl to read from the /proc/sys/
directory, as busybox does.

I suggest to add a  remark to the man page of sysctl, reporting the
difference between the two tools and an example of the alternate
syntax :
    sysctl net/ipv4/conf/eth0.100/forwarding


Thank you for your attention.
Best regards, Massimo

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: sysctl, argument parsing, possible bug
  2017-08-08 18:26 sysctl, argument parsing, possible bug Massimo Sala
@ 2017-08-08 19:04 ` Stephen Hemminger
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2017-08-08 19:04 UTC (permalink / raw)
  To: Massimo Sala; +Cc: LKML, Linux Kernel Network Developers

On Tue, 8 Aug 2017 20:26:36 +0200
Massimo Sala <massimo.sala.71@gmail.com> wrote:

> I make another test with kernel 4.9.32-15.41
> 
> sysctl procps version 3.2.8
> 
>     sysctl net.ipv4.conf.eth0.100.forwarding
>     error: "net.ipv4.conf.eth0.100.forwarding" is an unknown key
> 
> 
> so I install busybox :
> 
> BusyBox v1.19.3
> 
>     busybox sysctl net.ipv4.conf.eth0.100.forwarding
>     net.ipv4.conf.eth0.100.forwarding = 0
> 
> It is working, as I expect reading busybox source sysctl.c
> 
> 
> 
> Stephen, I test
>     sysctl net/ipv4/conf/eth0.100/forwarding
> I confirm it  works.
> 
> 
> What is the problem ?
> 
> As sysctl, also automation tools and scripts cannot be "netdev names
> aware", and so they fail using the usual dot notation.
> 
> 
> I don't pretend to change sysctl to read from the /proc/sys/
> directory, as busybox does.
> 
> I suggest to add a  remark to the man page of sysctl, reporting the
> difference between the two tools and an example of the alternate
> syntax :
>     sysctl net/ipv4/conf/eth0.100/forwarding
> 
> 
> Thank you for your attention.
> Best regards, Massimo

Busybox has always been a restricted subset of the upstream standard tools.
If you have problems with busybox take it up with those developers directly;
this is not the right mailing list for that.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: sysctl, argument parsing, possible bug
  2017-08-01 21:54     ` Cong Wang
@ 2017-08-02 21:53       ` Luis R. Rodriguez
  0 siblings, 0 replies; 8+ messages in thread
From: Luis R. Rodriguez @ 2017-08-02 21:53 UTC (permalink / raw)
  To: Cong Wang
  Cc: Massimo Sala, Luis R. Rodriguez, Kees Cook, LKML,
	Linux Kernel Network Developers

On Tue, Aug 01, 2017 at 02:54:51PM -0700, Cong Wang wrote:
> On Tue, Aug 1, 2017 at 2:34 PM, Massimo Sala <massimo.sala.71@gmail.com> wrote:
> > Do you confirm it is a sysctl parsing bug ?
> >
> > Bosybox handles these cases, so I think also standalone sysctl have to.
> >
> > Or at least someone must update sysctl docs / MAN about this.
> >
> 
> Maybe, sysctl seems (I never look into it) just to interpret dot as
> a separator, unless it reads from the /proc/sys/ directory, it can
> not know eth0.100 is actually a netdev name.

Using echo or sysctl -w works for me, try upgrading your procps,
I have procps-3.3.12. Busybox sysctl fails though, so it would
seems this is an issue with busybox, go fix that.

With procps-3.3.12.:

Setting:

ergon:~ # cat /proc/sys/net/ipv4/conf/eth0.100/forwarding 
1

ergon:~ # sysctl -w net.ipv4.conf.eth0/100.forwarding=0
net.ipv4.conf.eth0/100.forwarding = 0

ergon:~ # cat /proc/sys/net/ipv4/conf/eth0.100/forwarding 
0

Querying:

ergon:~ # sysctl net.ipv4.conf.eth0/100.forwarding
net.ipv4.conf.eth0/100.forwarding = 0

With busybox:

ergon:~ # busybox-static sysctl net.ipv4.conf.eth0/100.forwarding
sysctl: error: 'net.ipv4.conf.eth0.100.forwarding' is an unknown key

  Luis

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: sysctl, argument parsing, possible bug
  2017-08-01 21:27 ` Cong Wang
  2017-08-01 21:34   ` Massimo Sala
@ 2017-08-02  2:40   ` Stephen Hemminger
  1 sibling, 0 replies; 8+ messages in thread
From: Stephen Hemminger @ 2017-08-02  2:40 UTC (permalink / raw)
  To: Cong Wang; +Cc: Massimo Sala, LKML, Linux Kernel Network Developers

On Tue, 1 Aug 2017 14:27:37 -0700
Cong Wang <xiyou.wangcong@gmail.com> wrote:

> On Tue, Aug 1, 2017 at 1:47 PM, Massimo Sala <massimo.sala.71@gmail.com> wrote:
> > cat /proc/sys/net/ipv4/conf/eth0.100/forwarding
> > 0
> >
> > sysctl net.ipv4.conf.eth0.100.forwarding
> > error: "net.ipv4.conf.eth0.100.forwarding" is an unknown key
> >  
> 
> Use echo instead, sysctl doesn't understand eth0.100
> is a netdev name, sigh.

sysctl happily accepts / as a separator see man sysctl(8)

PARAMETERS
       variable
              The  name  of  a  key to read from.  An example is kernel.ostype.  The '/' separator is also
              accepted in place of a '.'.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: sysctl, argument parsing, possible bug
  2017-08-01 21:34   ` Massimo Sala
@ 2017-08-01 21:54     ` Cong Wang
  2017-08-02 21:53       ` Luis R. Rodriguez
  0 siblings, 1 reply; 8+ messages in thread
From: Cong Wang @ 2017-08-01 21:54 UTC (permalink / raw)
  To: Massimo Sala
  Cc: Luis R. Rodriguez, Kees Cook, LKML, Linux Kernel Network Developers

On Tue, Aug 1, 2017 at 2:34 PM, Massimo Sala <massimo.sala.71@gmail.com> wrote:
> Do you confirm it is a sysctl parsing bug ?
>
> Bosybox handles these cases, so I think also standalone sysctl have to.
>
> Or at least someone must update sysctl docs / MAN about this.
>

Maybe, sysctl seems (I never look into it) just to interpret dot as
a separator, unless it reads from the /proc/sys/ directory, it can
not know eth0.100 is actually a netdev name.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: sysctl, argument parsing, possible bug
  2017-08-01 21:27 ` Cong Wang
@ 2017-08-01 21:34   ` Massimo Sala
  2017-08-01 21:54     ` Cong Wang
  2017-08-02  2:40   ` Stephen Hemminger
  1 sibling, 1 reply; 8+ messages in thread
From: Massimo Sala @ 2017-08-01 21:34 UTC (permalink / raw)
  To: Cong Wang, Luis R. Rodriguez, Kees Cook
  Cc: LKML, Linux Kernel Network Developers

Do you confirm it is a sysctl parsing bug ?

Bosybox handles these cases, so I think also standalone sysctl have to.

Or at least someone must update sysctl docs / MAN about this.

Best regards, Sala


On 01/08/2017, Cong Wang <xiyou.wangcong@gmail.com> wrote:
> On Tue, Aug 1, 2017 at 1:47 PM, Massimo Sala <massimo.sala.71@gmail.com>
> wrote:
>> cat /proc/sys/net/ipv4/conf/eth0.100/forwarding
>> 0
>>
>> sysctl net.ipv4.conf.eth0.100.forwarding
>> error: "net.ipv4.conf.eth0.100.forwarding" is an unknown key
>>
>
> Use echo instead, sysctl doesn't understand eth0.100
> is a netdev name, sigh.
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: sysctl, argument parsing, possible bug
  2017-08-01 20:47 Massimo Sala
@ 2017-08-01 21:27 ` Cong Wang
  2017-08-01 21:34   ` Massimo Sala
  2017-08-02  2:40   ` Stephen Hemminger
  0 siblings, 2 replies; 8+ messages in thread
From: Cong Wang @ 2017-08-01 21:27 UTC (permalink / raw)
  To: Massimo Sala; +Cc: LKML, Linux Kernel Network Developers

On Tue, Aug 1, 2017 at 1:47 PM, Massimo Sala <massimo.sala.71@gmail.com> wrote:
> cat /proc/sys/net/ipv4/conf/eth0.100/forwarding
> 0
>
> sysctl net.ipv4.conf.eth0.100.forwarding
> error: "net.ipv4.conf.eth0.100.forwarding" is an unknown key
>

Use echo instead, sysctl doesn't understand eth0.100
is a netdev name, sigh.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* sysctl, argument parsing, possible bug
@ 2017-08-01 20:47 Massimo Sala
  2017-08-01 21:27 ` Cong Wang
  0 siblings, 1 reply; 8+ messages in thread
From: Massimo Sala @ 2017-08-01 20:47 UTC (permalink / raw)
  To: linux-kernel

cat /proc/sys/net/ipv4/conf/eth0.100/forwarding
0

sysctl net.ipv4.conf.eth0.100.forwarding
error: "net.ipv4.conf.eth0.100.forwarding" is an unknown key

uname -a
Linux ip-172-31-45-203 4.9.38-16.33.amzn1.x86_64 #1 SMP Thu Jul 20
01:31:29 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

cat /etc/issue
Amazon Linux AMI release 2017.03


best regards, Sala

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-08-08 19:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-08 18:26 sysctl, argument parsing, possible bug Massimo Sala
2017-08-08 19:04 ` Stephen Hemminger
  -- strict thread matches above, loose matches on Subject: below --
2017-08-01 20:47 Massimo Sala
2017-08-01 21:27 ` Cong Wang
2017-08-01 21:34   ` Massimo Sala
2017-08-01 21:54     ` Cong Wang
2017-08-02 21:53       ` Luis R. Rodriguez
2017-08-02  2:40   ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).