[Toybox] [landley/toybox] Add "ifconfig eth0 rename NEWNAME". (f22bec1)

Rob Landley rob at landley.net
Fri Apr 15 11:57:20 PDT 2022


On 4/15/22 12:21, enh-google wrote:
> SIOCSIFNAME is always != 0 ... this causes a test failure on Android:
> 
> |PASS: ifconfig dummy0 default ifconfig: '1269' > 4 bytes FAIL: ifconfig dummy0
> mtu 1269 echo -ne '' | ifconfig dummy0 mtu 1269 && ifconfig dummy0 | grep 1269 |
> wc -l --- expected 2022-04-13 23:00:46.511995473 +0000 +++ actual 2022-04-13
> 23:00:46.523995472 +0000 @@ -1 +0,0 @@ -1 |
> 
> i'm assuming this should have been |if (off == SIOCSIFNAME)|?

Sigh, yes, my bad. I tested the new feature, but not for regressions. :P

I'm setting up the mkroot/qemu based testing to actually do this sort of thing
as root in the vm (rather than "one typo and I lose all the open tabs on my dev
machine"), but now that I've got time to work on this it turns out I have a HUGE
BACKLOG of half-finished little things all of which need staring at to figure
out what I was trying to accomplish and then doing them if they're still worth
doing. (I don't have one dirty tree, I had SEVEN. Five now...)

> (or more likely
> |else if| --- seems like another bug that we call ioctl() twice for SIOCSIFMAP
> as we appear to do at the moment?)

No, that first if() is "if we're about to set, call get first". The macros are
long and only differ by one G/S letter (blame the headers), but it's "get, poke,
set" because mem_start, io_addr, and irq all live in the same struct. That get
intentionally doesn't have an else because it needs the poke to update the one
of the three we're changing.

I'll add a comment line.

Rob



More information about the Toybox mailing list