On Fri, 2010-06-04 at 21:50 +0800, Mu Qiao wrote: > Hi Dan, > > Gentoo NM plugin has to read dhcp hostname and clientid from > configuration file of dhcpcd or dhclient. > > Currently I just test whether the configuration file of dhcpcd or > dhclient exists to determine which one is used. Could I make use of the > switch "--with-dhcpcd=yes" to enable conditional compilation? > for example: > #ifdef DHCPCD_PATH > //handling dhcpcd configuration file > #else > //handling dhclient configuration file > #endif > > If this could be achieved, what should follow "#ifdef"? Should I include > any header file?
I changed NM a few months ago to allow either DHCP client at runtime, so it's possible that support for *both* is compiled in. It's then selectable via the config file /etc/NetworkManager/NetworkManager.conf or (older name) /etc/NetworkManager/nm-system-settings.conf. I think at this point, you should probably look for that file and use the DHCP client listed there. The actual code that determines which DHCP client to use at run time is in: src/dhcp-manager/nm-dhcp-manager.c::get_client_type() It's probably sufficient to grab the variable out of the .conf file, and if that doesn't exist or isn't valid, use dhclient (if it's installed) and then fallback dhcpcd (if it's installed). Dan _______________________________________________ networkmanager-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/networkmanager-list
