Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 11933

Summary: -h hostname forgotten on renewal
Product: [Retired] Red Hat Linux Reporter: gkm
Component: pumpAssignee: Erik Troan <ewt>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-07-25 17:28:19 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
possible fix (aka quick hack)
none
blah. this one should work better; wrong version of diff last time. none

Description gkm 2000-06-06 23:12:54 UTC
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.

Comment 1 gkm 2000-06-06 23:13:48 UTC
Created attachment 319 [details]
possible fix (aka quick hack)

Comment 2 gkm 2000-06-06 23:48:02 UTC
Created attachment 320 [details]
blah.  this one should work better; wrong version of diff last time.

Comment 3 Tomasz Kepczynski 2000-07-25 17:28:19 UTC
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.

Comment 4 Erik Troan 2000-08-03 16:23:32 UTC
Fixed in the rawhide/pinstrip pump

Comment 5 Tomasz Kepczynski 2000-09-16 13:45:22 UTC
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.

Comment 6 Patrick J. LoPresti 2000-10-26 16:20:23 UTC
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.


Comment 7 Tomasz Kepczynski 2000-10-28 09:53:31 UTC
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