Hello community, here is the log from the commit of package dhcp checked in at Sun May 7 15:53:25 CEST 2006. -------- --- dhcp/dhcp.changes 2006-03-29 15:48:09.000000000 +0200 +++ STABLE/dhcp/dhcp.changes 2006-05-04 23:01:35.000000000 +0200 @@ -1,0 +2,5 @@ +Thu May 4 23:01:10 CEST 2006 - rml@suse.de + +- Add "-H" flag for setting hostname (Novell major bug #139532) + +------------------------------------------------------------------- New: ---- dhcp-send-hostname-rml.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dhcp.spec ++++++ --- /var/tmp/diff_new_pack.xajkQq/_old 2006-05-07 15:52:29.000000000 +0200 +++ /var/tmp/diff_new_pack.xajkQq/_new 2006-05-07 15:52:29.000000000 +0200 @@ -16,7 +16,7 @@ Group: Productivity/Networking/Boot/Servers Autoreqprov: on Version: 3.0.3 -Release: 15 +Release: 22 Summary: Common Files Used by ISC DHCP Software URL: http://www.isc.org/isc/dhcp.html Source: dhcp-%{version}.tar.bz2 @@ -67,6 +67,7 @@ Patch80: dhcp-3.0.2-extended_option_environment.patch Patch81: dhcp-3.0.3-dhclient-script-dhcdbd.patch Patch83: dhcp-3.0.3-dhclient-nis-01-thoenig.patch +Patch84: dhcp-send-hostname-rml.patch Obsoletes: dhcp-base Provides: dhcp-base:/usr/bin/omshell PreReq: /bin/touch /sbin/chkconfig @@ -198,6 +199,7 @@ %patch80 -p1 %patch81 -p1 %patch83 -p1 +%patch84 -p1 find . -type f -name \*.cat\* -exec rm -f {} \; cp -p %{S:1} %{S:2} %{S:11} %{S:12} %{S:14} %{S:32} %{S:33} . for i in README LIESMICH; do @@ -485,6 +487,8 @@ %doc %{_mandir}/man3/dhcpctl.3.gz %changelog -n dhcp +* Thu May 04 2006 - rml@suse.de +- Add "-H" flag for setting hostname (Novell major bug #139532) * Wed Mar 29 2006 - poeml@suse.de - fix two further include paths in dhcpctl.3 and omapi.3 * Wed Mar 29 2006 - poeml@suse.de ++++++ dhcp-send-hostname-rml.patch ++++++ Add -H flag to specify a hostname to send to the DHCP server client/dhclient.8 | 8 ++++++++ client/dhclient.c | 41 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 47 insertions(+), 2 deletions(-) diff -urN dhcp-3.0.3/client/dhclient.8 dhcp/client/dhclient.8 --- dhcp-3.0.3/client/dhclient.8 2006-05-04 13:06:38.000000000 -0400 +++ dhcp/client/dhclient.8 2006-05-04 13:08:33.000000000 -0400 @@ -33,6 +33,9 @@ .I port ] [ +.B -H hostname +] +[ .B -d ] [ @@ -165,6 +168,11 @@ transmit on, the client will also use a different destination port - one greater than the specified destination port. .PP +The +.B -H +flag may be used to specify a client hostname that should be sent to +the DHCP server. +.PP The DHCP client normally transmits any protocol messages it sends before acquiring an IP address to, 255.255.255.255, the IP limited broadcast address. For debugging purposes, it may be useful to have diff -urN dhcp-3.0.3/client/dhclient.c dhcp/client/dhclient.c --- dhcp-3.0.3/client/dhclient.c 2006-05-04 13:06:38.000000000 -0400 +++ dhcp/client/dhclient.c 2006-05-04 13:09:41.000000000 -0400 @@ -104,6 +104,7 @@ int no_dhclient_db = 0; int no_dhclient_pid = 0; int no_dhclient_script = 0; + char *dhclient_hostname = NULL; char *s; /* Make sure we have stdin, stdout and stderr. */ @@ -186,6 +187,15 @@ if (++i == argc) usage (); relay = argv [i]; + } else if (!strcmp (argv [i], "-H")) { + if (++i == argc || !argv[i] || *(argv[i]) == '\0') + usage (); + if (strlen (argv[i]) >= DHCP_OPTION_LEN) { + log_error("-H option host-name string \"%s\" is too long:" + "maximum length is %d characters", argv[i], DHCP_OPTION_LEN-1); + exit(1); + } + dhclient_hostname = argv [i]; } else if (!strcmp (argv [i], "-nw")) { nowait = 1; } else if (!strcmp (argv [i], "-n")) { @@ -350,6 +360,33 @@ /* Parse the dhclient.conf file. */ read_client_conf (); + /* If the user specified a hostname, send it here and now */ + if ((dhclient_hostname != NULL) && (*dhclient_hostname != '\0') ) { + struct parse *cfile = NULL; + char buf[DHCP_OPTION_LEN + 40]; + int len; + + len = sprintf (buf, "send host-name \"%s\";", dhclient_hostname); + + status = new_parse (&cfile, -1, buf, len, "host-name option", 0); + + if (status != ISC_R_SUCCESS) + log_fatal ("Cannot parse dhcp-client-identifier send statement!"); + + for (;;) { + const char *val = NULL; + int token; + + token = peek_token (&val, (unsigned *)0, cfile); + if (token == END_OF_FILE) + break; + + parse_client_statement (cfile, NULL, &top_level_config); + + } + end_parse (&cfile); + } + /* Parse the lease database. */ read_client_leases (); @@ -487,9 +524,9 @@ log_info (url); #ifdef EXTENDED_NEW_OPTION_INFO - log_error ("Usage: dhclient [-1dqr] [-nwx] [-p <port>] %s", + log_error ("Usage: dhclient [-1dqr] [-nwx] [-H <hostname>] [-p <port>] %s", #else - log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s", + log_error ("Usage: dhclient [-1dqr] [-nw] [-H <hostname>] [-p <port>] %s", #endif "[-s server]"); log_error (" [-cf config-file] [-lf lease-file]%s", ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de