Hello Michael, > First, Thanks for the reply. I still not clear why in the changes list it > shows that > sometimes bb_info_msg is changed to printf and sometimes changed to > bb_error_msg. Actually, did a test and modified the dhcpc.c to change the > bb_error_msg to printf to see if it would work the same. Did find that I also > had to add \n or output was on same line, but it did get the output to go to > stdout instead of stderr, and had the output without the added field. The > case issue would still be there, but that is an easy fix. It is not the > inconvience, but the consistance, and it may be there is good reason that I > am not aware of?
As I see it, this was not changed with output consistency in mind, but to send what really is logging output to stderr (and, at the same time, cut in binary size a few bytes). That udhcpc output was logging, so it was wrong to output it to stdout. You can argue with Denys about this change, but really the right way (and actually *easiest* one, IMO) to get information from udhcpc is using the callback script. > Second, I was not aware that the udhcpc.sh was a script to be modified?? I > do see the variable $ip, but it is only one renew section, and doesn't seem to > show where it gets defined. Is there somewhere that this process is defined? > A user had submitted the script that would process systems with multiple nics > to find the active nics, and which one actually got an IP address. Since it > worked fine I didn't go farther. I've got a couple systems with 2 nics, and > have > one system that has 9 ethernet ports with one single nic, and two 4 port nics, > and it works fine with that. Yes, the callback script can be customized, although it usually doesn't have to. That script is called with some information extracted from the packet and set as environment variables using fill_envp() (in https://git.busybox.net/busybox/tree/networking/udhcp/dhcpc.c#n418). You can find there the ones you need. I'm not an expert in DHCP, so I can't help you with which information is available in each stage in with the callback is used. Hope that helps, Xabier Oneca_,,_ _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
