[BusyBox] nameif applet patch

Glenn McGrath bug1 at optushome.com.au
Fri Dec 13 01:09:03 UTC 2002


On Fri, 13 Dec 2002 09:16:44 +0200 (EET)
Nick Fedchik <fnm at fusion.ukrsat.com> wrote:

> On Fri, 13 Dec 2002, Glenn McGrath wrote:
> 
> > I changed the error messsage handling to save a couple of hundred more
> > bytes, and changes the error messages to make them closer to upstream.
> That's ok, it was in my TODO.
> IMHO somethink like that serror_msg_and_die() should be in the busybox
> utils library. Also it will be useful, if this call will have a flag
> "to die or not to die" :)))
> 

hmm, i did have a quick look around for other places that use syslog, most
other applets are more definite about where they are logging to, they dont
need the "if (use_syslog)", i guess that could have a flag as well.

Something that keep in mind at least.

> > It could have got you to check it first, but i checked it in anyway,
> > we can work from cvs if its still needs changes.
> IMHO its still need changes.
> I get the latest version from anon cvs.
> 
> For example, look here - it's incorrect message:
> 188:                if (ioctl(ctl_sk, SIOCGIFHWADDR, &ifr) < 0) {
> 189:                       serror_msg_and_die(use_syslog, "cannot change
> name of %s  to %s: %s", ifr.ifr_name, ch->ifname, strerror(errno));
> 190:                }
> This call to get macaddr, but msg like one for
> ioctl(ctl_sk, SIOCSIFNAME, &ifr)
> so I think You just hurry and make a copy without checks.
> Also it should be
> 			continue;
> but not errmsg/exit, because the called interface probably has no mac.
> 

I wasnt sure about what this error message should be, but i think it did
needed one, it was failing silently for me.

I will fix them up.


Glenn 




More information about the busybox mailing list