OpenWrt Forum Archive

Topic: ifup / ifdown bugfix patches

The content of this topic has been archived on 28 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi!

The default ifup script shipped with OpenWRT has a rather serious bug regarding pppoe, it calls pppoecd with the wrong parameters causing PPPoE to function unreliably. The attached ifup.diff patch fixes this and additionally tries to make the network device pid file handling a bit cleaner.

Greetings,

  Gunter

The args pppoecd is called with were copied verbatim from the Linksys firmware. The nvram variables ppp_lcpechointerval and ppp_lcpechofails in your patch don't exist in the stock firmware.  In keeping with OpenWRT's tradition of EDIT: *not* unneccesarily creating new nvram vars, we use the Linksys vars in the same way they do (however misnamed they may be).

In answer to your comment:  ## -I $redial  # <= FIXME, what's that meant to be?
You can find the answer in:
redial=$(nvram get ppp_redialperiod)
So, the variable named ppp_redialperiod is actually used as the time interval between LCP echo-requests, as configured by default in the stock firmware.

In the same manner, the variable ppp_idletime is actually used as the timeout for LCP echos.

How the command argument are used is defined in buildroot/build_mipsel/WRT54GS/release/src/router/ppp/pppoecd/options.c.

Basically, the nvram variables passed as args to pppoecd are simply misnamed by Linksys, but they do seem to be used in a consistent manner.  We perpetuate these misnomers in the interests of 1) To avoid unnecessarily creating new nvram vars and contributing to NVRAM pollution a la Sveasoft, and 2) To maintain compatibility with the stock firmware.

> ppp_lcpechointerval and ppp_lcpechofails in your patch
> don't exist in the stock firmware.

Right, I forgot to mention these. I wanted to add to the text that one maybe should hardcode these to sane values, if one does not want to add them to OpenWRT.

> In the same manner, the variable ppp_idletime is actually
> used as the timeout for LCP echos.

Which means, in other words, that the idle time of the link cannot be set in OpenWRT. (Which OTOH does not matter much as pppoecd is called with -k

> How the command argument are used is defined in
>  buildroot/build_mipsel/WRT54GS/release/src/router/ppp/pppoecd/options.c.

Yes, I know, that's where I found out why my setup didn't work as it should.

> Basically, the nvram variables passed as args to pppoecd
> are simply misnamed by Linksys, but they do seem to be
> used in a consistent manner. We perpetuate these misnomers

Ok. I don't know Sveasoft's Firmware, but maybe one should at least then replace my patch with one that updates the comments in /sbin/ifup, explicitely stating that the call which seems to do thing (a) does something different in reality? (And your short explanation why it's THE RIGHT WAY(TM) the way it is. wink

It least to me pppoecd's behaviour was pretty confusing at first...

Greetings,

  Gunter

The discussion might have continued from here.