the command line specified hostname is forgotten about when it comes time to renew the dhcp lease. looks like it should be stored in `intf' and used if the bootp reponses didn't include a hostname... this will make ddns work in some environments.
Created attachment 319 [details] possible fix (aka quick hack)
Created attachment 320 [details] blah. this one should work better; wrong version of diff last time.
This causes problem with ddns. As pump gets hostname at renewal from gethostname it may get FQDN. This will be passed to server and it will cause change in dns to add domain one more time (it depends on server configuration however). Pump should always send the same hostname it contacts dhcp server I guess.
Fixed in the rawhide/pinstrip pump
This still doesn't work correctly as in pump-0.7.11-2. When lease is obtained for the first time hostname specified with -h is used and dhcp properly registers hostname.domain in DNS. When lease is renewed fully qualified domain name is send and therefore dhcp registers hostname.domain.domain in DNS which is at least inconvenient.
I can confirm that this bug is *still present* as recently as pump 0.8.2. The original bug, which was pump forgetting the -h option, is fixed. But the new problem, which is that pump uses hostname() instead of the -h option when renewing a lease, has not been fixed. Using hostname() is wrong, because it is not the same as the -h option. In particular, the hostname() is often fully-qualified, and many schemes for updating the DNS from DHCP data expect the client hostname to be the short name. Please re-open this bug.
The fault is not resolved in pump-0.8.4-1 as shipped in RawHide. It seems that the reason it occurs is as follows: 1. pump uses command line provided hostname when obtaining lease for the first time 2. dhcp responds but does not send hostname in vendor options (option 12) 3. pump stores information about interface in a record but it doesn't store hostname as it relies on dhcp server only to provide it 4. when pump tries to renew lease it sees that there is no hostname in record describing device and falls back to gethostname 5. gethostname returns FQDN (as set at system starup) and this is the fault reproduced The following patch (against pump-0.8.4) works for me but it may break your system (it certainly will if pump tries to use sethostname) --- dhcp.c.orig Thu Aug 17 00:33:43 2000 +++ dhcp.c Sat Oct 28 11:05:28 2000 @@ -1323,6 +1323,15 @@ close(s); parseReply(&bresp, intf); + if(reqHostname) { + if (intf->hostname) + free(intf->hostname); + if ((intf->hostname = malloc(strlen(reqHostname) + 1))) { + strcpy(intf->hostname, reqHostname); + intf->set |= PUMP_NETINFO_HAS_HOSTNAME; + syslog (LOG_DEBUG, "intf: reqHostname: %s", intf->hostname); + } + } if (flags & PUMP_FLAG_FORCEHNLOOKUP) intf->set &= ~(PUMP_NETINFO_HAS_DOMAIN | PUMP_NETINFO_HAS_HOSTNAME); Patch is applied at very end of pumpDhcpRun function. Please reopen this bug reported and hopefully have it sorted at last... Regards, Tomek