Re: Failing dhcp



Hi Jason,


I'm running Slackware 10.2 with 2.6.13 kernel

I build all my packages from source, with the following patches from Gentopia (which i attached), cause those would build right:

dhcp:
dhcp-3.0.2-extended_option_environment.patch
dhcp-3.0.2-dhclient-no_isc_blurb.patch
dhcp-3.0.2-dhclient_nodelay.patch
dhcp-3.0.2-dhclient_decline_backoff.patch
dhcp-3.0.2-dhclient_script_fast+arping-1.patch
dhcp-3.0.2-dhclient-script-dbus-dhcdbd.patch
dhcp-3.0.2-slackware-ify.patch
dhclient-ntp.patch

dhcdbd:
dhcdbd-1.9-slackware-ify.patch

networkmanager:
networkmanager-slackware-ify.patch

On 10/25/05, Jason Vas Dias <jvdias redhat com> wrote:

Hi Theetjuh -

What OS are you using ?

Is there any reason why you can't download the latest NetworkManager
source rpms and dependencies:
ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/NetworkManager-0.5.1-2.src.rpm
ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/dhcdbd-1.9-1.src.rpm
ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/dhclient-3.0.3-10.src.rpm
ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/bind-9.3.1-20.src.rpm
ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/dbus-0.50-1.src.rpm

And simply rebuild them with 'rpmbuild --rebuild $srcrpm' ?

> >         Oct 22 14:30:51 poseidon dhclient: Internet Systems Consortium
> >         DHCP Client V3.0.3

This shows you are not running the Red Hat patched dhclient, whose version string
would be  :
            DHCP Client V3.0.3-RedHat

> >         Oct 22 14:30:51 poseidon dhclient:
> >         Oct 22 14:30:51 poseidon dhcdbd: Unrequested down ?:3

dhclient has exited abnormally, perhaps because it does not recognize the '-x'
option, support for which is provided by the Red Hat dhclient patches - specifically,
'dhcp-3.0.2-extended_option_environment.patch' . You can stop dhcdbd supplying the -x
option by compiling dhcdbd with -DDHCLIENT_EXTENDED_OPTION_ENVIRONMENT=0 , but then
it will be unable to handle user-defined DHCP options.

> >         And this in /var/log/syslog:
> >         Oct 22 14:30:51 poseidon dhclient: eth0: not found

Since eth0 was not configured, dhcdbd has no record of it .

> >         Oct 22 14:31:29 poseidon NetworkManager: <WARNING>^I  ():
> >         nm_spawn_process('/etc/rc.d/rc.howl restart'): could not spawn
> >         process. (Failed to execute child process
> >         "/etc/rc.d/rc.howl" (No such file or directory))

NetworkManager depends on howl ? Perhaps you should consider installing howl:
ftp://download.fedora.redhat.com/pub/fedora/linux/core/development/SRPMS/howl-0.9.8-4.src.rpm

> >         Oct 22 14:31:43 poseidon NetworkManager: compute_nameservers:
> >         assertion `config != NULL' failed
> >

It looks like you may be missing some NetworkManager patches also.

I strongly suggest just rebuilding from the latest src rpms .

Regards,
Jason Vas Dias



--


Greetz
Theetjuh
--- src/NetworkManagerMain.h	2005-08-06 07:25:47.000000000 -0500
+++ src/NetworkManagerMain.h	2005-08-06 07:27:56.000000000 -0500
@@ -49,8 +49,8 @@
 typedef struct NMVPNManager NMVPNManager;
 typedef struct NMDHCPManager NMDHCPManager;
 
-#define DHCP_SERVICE_NAME	"com.redhat.dhcp"
-#define DHCP_OBJECT_PATH		"/com/redhat/dhcp"
+#define DHCP_SERVICE_NAME	"com.slackware.dhcp"
+#define DHCP_OBJECT_PATH		"/com/slackware/dhcp"
 
 typedef struct NMData
 {
--- src/dhcp-manager/nm-dhcp-manager.c	2005-08-06 07:25:47.000000000 -0500
+++ src/dhcp-manager/nm-dhcp-manager.c	2005-08-06 07:27:29.000000000 -0500
@@ -561,7 +561,7 @@
 	dev = nm_get_device_by_iface (manager->data, member);
 	if (dev && (req = nm_device_get_act_request (dev)))
 	{
-		if (dbus_message_is_signal (message, "com.redhat.dhcp.state", nm_device_get_iface (dev)))
+		if (dbus_message_is_signal (message, "com.slackware.dhcp.state", nm_device_get_iface (dev)))
 		{
 			guint8	state;
 
--- README	2005-10-20 02:49:46.000000000 -0500
+++ README	2005-10-20 02:58:59.000000000 -0500
@@ -27,9 +27,9 @@
 	(-s | -S | --system)                : use system bus
 	(-u | -U | --session)               : use session bus
 	(-n | -N | --no-daemon )            : do not fork / daemonize: stay in foreground 
-	(-d | -D | --dest=)  <destination>  : set connection destination - default: 'com.redhat.dhcp'
-	(-o | -O | --path=)  <path>         : set object path prefix     - default: '/com/redhat/dhcp'
-	(-i | -I | --prefix=)<prefix>       : set interface prefix       - default: 'com.redhat.dhcp'
+	(-d | -D | --dest=)  <destination>  : set connection destination - default: 'com.slackware.dhcp'
+	(-o | -O | --path=)  <path>         : set object path prefix     - default: '/com/slackware/dhcp'
+	(-i | -I | --prefix=)<prefix>       : set interface prefix       - default: 'com.slackware.dhcp'
 
 	NOTE:
 	dhcdbd depends on dhclient-script extensions present in Red Hat dhclient versions
@@ -40,32 +40,32 @@
   	Object Path 		Member		Interface    	Purpose
         (-O suffix)				( -I suffix )
 
-	/com/redhat/dhcp/	$ip_if		up		Start dhclient session for $ip_if
+	/com/slackware/dhcp/	$ip_if		up		Start dhclient session for $ip_if
 								($ip_if: IPv4 interface name)
 								Accepts up to 2 optional arguments:
                                                                 arg 1: uint32:  dhclient-script flags
 								arg 2: uint32:  dhclient flags 
 								(see below) 
 
-	/com/redhat/dhcp/	$ip_if		down		Stop dhclient session for $ip_if
+	/com/slackware/dhcp/	$ip_if		down		Stop dhclient session for $ip_if
 
-	/com/redhat/dhcp/       $ip_if		text.get        returns  DHCP options for $ip_if/
+	/com/slackware/dhcp/       $ip_if		text.get        returns  DHCP options for $ip_if/
 			     or $ip_if/$option			or single $ip_if/$option option
 								as text strings
 
- 	/com/redhat/dhcp/	$ip_if		binary.get	returns  DHCP options for $ip_if/
+ 	/com/slackware/dhcp/	$ip_if		binary.get	returns  DHCP options for $ip_if/
 		             or $ip_if/$option			or single $ip_if/$option option
 								as "array of byte" D-BUS type corresponding
 								to "C" structure
 	
-	/com/redhat/dhcp/       $ip_if				returns  DHCP options for $ip_if/
+	/com/slackware/dhcp/       $ip_if				returns  DHCP options for $ip_if/
 			     or $ip_if/$option  dbus.get        or single $ip_if/$option option
 								as binary D-BUS types
 
-	/com/redhat/dhcp/       $ip_if/old.$option              Returns options with "old" prefix
+	/com/slackware/dhcp/       $ip_if/old.$option              Returns options with "old" prefix
 				      {text,dbus,binary}.get	(from previous, expired lease)
 
-        /com/redhat/dhcp/$ip_if/ $option {text,dbus}.format.get Returns DHCP option format for option:
+        /com/slackware/dhcp/$ip_if/ $option {text,dbus}.format.get Returns DHCP option format for option:
 								byte   : dhcp option code
 								string : dhcp option type string
 	                                                        byte   : dhcp universe code
@@ -74,14 +74,14 @@
 	                                                        byte   : 1: is "NEW" user-defined option
                                                                          0: is standard dhcp option
 								
-	/com/redhat/dhcp   	 $ip_if          state          dhcdbd broadcasts STATE SIGNAL messages 
+	/com/slackware/dhcp   	 $ip_if          state          dhcdbd broadcasts STATE SIGNAL messages 
 								to the null destination on the system
-								bus from the com.redhat.dhcp.state
-								interface from member /com/redhat/dhcp/$ip_if
+								bus from the com.slackware.dhcp.state
+								interface from member /com/slackware/dhcp/$ip_if
 								so all processes can be informed of dhcp
 								state changes.
 
-	/com/redhat/dhcp/         $ip_if         subscribe.(binary|text|dbus)  (string)       
+	/com/slackware/dhcp/         $ip_if         subscribe.(binary|text|dbus)  (string)       
 								Subscription method taking one string 
 								option name argument.
 								dhcdbd will send signals to the 'subscribe' sender
@@ -90,15 +90,15 @@
 								The subscriber is removed if its name is no longer
 								valid.	
 
-	/com/redhat/dhcp/	  subscribe.binary ($option)    Prospective subscription: 
+	/com/slackware/dhcp/	  subscribe.binary ($option)    Prospective subscription: 
 		                  subscribe.text    "           Subscribers can now omit the interface and will 
                                   subscribe.dbus                be sent option values from any interface
 
-	/com/redhat/dhcp	  list				return string list of configured interface names
+	/com/slackware/dhcp	  list				return string list of configured interface names
 	
-	/com/redhat/dhcp	  (up|ping)                     Just start up and do nothing
+	/com/slackware/dhcp	  (up|ping)                     Just start up and do nothing
 
-	/com/redhat/dhcp	  (down|quit|exit|shutdown)     Exit
+	/com/slackware/dhcp	  (down|quit|exit|shutdown)     Exit
 								(Also exits automatically on Disconnected signal from
 								/org/freedesktop/DBus/Local).
 
@@ -206,8 +206,8 @@
 	Subscribers  can invoke the "subscribe" method on an interface. Eg, to subscribe to changes of the
         binary "ip-address" option on the eth0 interface:
 		Subscriber sends "method_call" message:
-			path:       /com/redhat/dhcp/eth0
-			interface:  com.redhat.dhcp.subscribe
+			path:       /com/slackware/dhcp/eth0
+			interface:  com.slackware.dhcp.subscribe
 			member:	    binary
 			arguments:  string:'ip-address'
 		dhcdbd sends RETURN message with uint32:0 argument if subscription succeeds, or an ERROR
@@ -217,9 +217,9 @@
 	destination, whenever a new value of ip-address for eth0 is created, 
 		dhcdbd will sent a subscribe signal to the subscriber's destination:
 	                destination: subscriber - "sender" of subscribe message
-			path:       /com/redhat/dhcp/eth0
+			path:       /com/slackware/dhcp/eth0
 			member:	    ip_address
-			interface:  com.redhat.dhcp.subscribe.binary
+			interface:  com.slackware.dhcp.subscribe.binary
 			arguments:  name: STRING "ip-address"
 				   value: ARRAY BYTE length=4 [ B B B B ]
 
@@ -242,10 +242,10 @@
 	
 	Here are some examples using dbus-send to contact dhcdbd:
 
-	/usr/bin/dbus-send --dest=com.redhat.dhcp --type=method_call \
+	/usr/bin/dbus-send --dest=com.slackware.dhcp --type=method_call \
 			   --print-reply --reply-timeout=20000 \
-		           /com/redhat/dhcp/eth0 \
-			   com.redhat.dhcp.up uint32:7 uint32:2
+		           /com/slackware/dhcp/eth0 \
+			   com.slackware.dhcp.up uint32:7 uint32:2
 	
 	Brings up interface eth0, telling dhclient-script not to modify resolv.conf,
 	perform ifconfigs, or modify routes, but TO configure ntp.conf, ntp/step-tickers
@@ -254,18 +254,18 @@
 
 	Subsequent "up"s without "down"s invoke the "down" automatically followed by the "up".
 
-	$ /usr/bin/dbus-send --system --dest=com.redhat.dhcp --type=method_call --print-reply \
-	  --reply-timeout=20000 /com/redhat/dhcp/eth0 com.redhat.dhcp.text.get.ip_address
+	$ /usr/bin/dbus-send --system --dest=com.slackware.dhcp --type=method_call --print-reply \
+	  --reply-timeout=20000 /com/slackware/dhcp/eth0 com.slackware.dhcp.text.get.ip_address
 	method return sender=:1.3 -> dest=:1.7	
  	1 string "172.16.80.119"
 
-	$ /usr/bin/dbus-send --system --dest=com.redhat.dhcp --type=method_call --print-reply \ 
-	  --reply-timeout=20000 /com/redhat/dhcp/eth0 com.redhat.dhcp.dbus.get.ip_address
+	$ /usr/bin/dbus-send --system --dest=com.slackware.dhcp --type=method_call --print-reply \ 
+	  --reply-timeout=20000 /com/slackware/dhcp/eth0 com.slackware.dhcp.dbus.get.ip_address
 	method return sender=:1.3 -> dest=:1.8
  	1 uint32 2001735852
 
-	$ /usr/bin/dbus-send  --system --dest=com.redhat.dhcp --type=method_call --print-reply \
-	  --reply-timeout=20000 /com/redhat/dhcp/eth0 com.redhat.dhcp.dbus.format.get.routers
+	$ /usr/bin/dbus-send  --system --dest=com.slackware.dhcp --type=method_call --print-reply \
+	  --reply-timeout=20000 /com/slackware/dhcp/eth0 com.slackware.dhcp.dbus.format.get.routers
 	  method return sender=:1.228 -> dest=:1.251
 	  0 byte 3
 	  1 string "IA"
@@ -297,16 +297,16 @@
 
 	For instance, if the client's dhclient.conf, and the server's dhcpd.conf, contain:
 				 
-	option space redhat;
-	option redhat.routes code 1 = array of { ip-address, integer 8, ip-address, integer 16, integer 8 } ;
+	option space slackware;
+	option slackware.routes code 1 = array of { ip-address, integer 8, ip-address, integer 16, integer 8 } ;
 
 	And the server's dhcpd.conf contains:
 	
-	subnet ...{ ... option redhat.route 172.16.80.0 22 172.16.83.254 1 1, 192.168.10.0 24 192.168.10.254 2 1;... }
+	subnet ...{ ... option slackware.route 172.16.80.0 22 172.16.83.254 1 1, 192.168.10.0 24 192.168.10.254 2 1;... }
 
 	And the client's dhclient.conf contains:
 
-	request ... redhat.routes;
+	request ... slackware.routes;
 
 	Then these routes will be populated in the dhcdbd options and returned in response to gets .
 
--- dhcdbd.h	2005-10-20 02:49:46.000000000 -0500
+++ dhcdbd.h	2005-10-20 02:50:11.000000000 -0500
@@ -19,13 +19,13 @@
 #define DHCDBD_H
 
 #ifndef DHCDBD_DESTINATION
-#define DHCDBD_DESTINATION      "com.redhat.dhcp"
+#define DHCDBD_DESTINATION      "com.slackware.dhcp"
 #endif
 #ifndef DHCDBD_OBJECT_PATH
-#define DHCDBD_OBJECT_PATH      "/com/redhat/dhcp"
+#define DHCDBD_OBJECT_PATH      "/com/slackware/dhcp"
 #endif
 #ifndef DHCDBD_INTERFACE_PREFIX
-#define DHCDBD_INTERFACE_PREFIX "com.redhat.dhcp"
+#define DHCDBD_INTERFACE_PREFIX "com.slackware.dhcp"
 #endif
 #ifndef DHCDBD_DHCLIENT_BIN
 #define DHCDBD_DHCLIENT_BIN     "/sbin/dhclient"
--- main.c	2005-10-20 02:49:46.000000000 -0500
+++ main.c	2005-10-20 02:50:11.000000000 -0500
@@ -12,9 +12,9 @@
 	 "Usage:\n[\t[(-s | -S | --system)\t\t   : use system bus]\n"
 	 "\t[(-u | -U | --session)             : use session bus]\n"
 	 "\t[(-n | -N | --no-daemon)]          : don't daemonize if --(system|session) argument given\n"
-	 "\t[(-d | -D | --dest=) <destination> : set connection destination - default: com.redhat.dhcp]\n"
-	 "\t[(-o | -O | --path=) <path>        : set object path prefix     - default: /com/redhat/dhcp]\n"
-	 "\t[(-i | -I | --prefix=) <prefix>    : set interface prefix       - default: com.redhat.dhcp]\n]\n"
+	 "\t[(-d | -D | --dest=) <destination> : set connection destination - default: com.slackware.dhcp]\n"
+	 "\t[(-o | -O | --path=) <path>        : set object path prefix     - default: /com/slackware/dhcp]\n"
+	 "\t[(-i | -I | --prefix=) <prefix>    : set interface prefix       - default: com.slackware.dhcp]\n]\n"
     );
 }
 
--- service/dhcdbd.service	2005-10-20 02:49:46.000000000 -0500
+++ service/dhcdbd.service	2005-10-20 02:50:12.000000000 -0500
@@ -1,3 +1,3 @@
 [D-BUS Service]
-Name=com.redhat.dhcp
+Name=com.slackware.dhcp
 Exec=/sbin/dhcdbd
--- system.d/dhcdbd.conf	2005-10-20 02:49:46.000000000 -0500
+++ system.d/dhcdbd.conf	2005-10-20 02:51:14.000000000 -0500
@@ -3,17 +3,17 @@
 <busconfig>
     <servicedir>/usr/share/dbus-1/services</servicedir>
     <policy user="root">
-	    <allow own="com.redhat.dhcp"/>
-	    <allow send_interface="com.redhat.dhcp"/>
-	    <allow send_destination="com.redhat.dhcp"/>
+	    <allow own="com.slackware.dhcp"/>
+	    <allow send_interface="com.slackware.dhcp"/>
+	    <allow send_destination="com.slackware.dhcp"/>
     </policy>
     <policy user="named">
-            <allow send_interface="com.redhat.dhcp"/>
-            <allow send_destination="com.redhat.dhcp"/>
+            <allow send_interface="com.slackware.dhcp"/>
+            <allow send_destination="com.slackware.dhcp"/>
     </policy>
     <policy context="default">
-            <deny own="com.redhat.dhcp"/>
-            <deny send_destination="com.redhat.dhcp"/>
-            <deny send_interface="com.redhat.dhcp"/>
+            <deny own="com.slackware.dhcp"/>
+            <deny send_destination="com.slackware.dhcp"/>
+            <deny send_interface="com.slackware.dhcp"/>
     </policy>    
 </busconfig>
--- tests/t.c	2005-10-20 02:49:46.000000000 -0500
+++ tests/t.c	2005-10-20 02:50:12.000000000 -0500
@@ -55,14 +55,14 @@
 	            "new_subnet_mask=255.255.252.0\n"
 	            "old_routers=172.16.83.254 172.16.80.118\n"
 	            "new_routers=172.16.83.254 172.16.80.118\n"
-	            "old_domain_name=boston.redhat.com\n"
-	            "new_domain_name=boston.redhat.com\n"
+	            "old_domain_name=boston.slackware.com\n"
+	            "new_domain_name=boston.slackware.com\n"
                     "old_dhcp.domain_name_servers=172.16.76.10 172.16.52.28\n"
                     "new_dhcp.domain_name_servers=172.16.76.10 172.16.52.28\n"
-	            "new_redhat.dhcp_type=3\n"
-	            "new_redhat._universe_.dhcp_type=1:l\n"
-	            "new_redhat.servers=172.16.80.118 172.16.80.119\n"
-	            "new_redhat._universe_.servers=2:IA\n"
+	            "new_slackware.dhcp_type=3\n"
+	            "new_slackware._universe_.dhcp_type=1:l\n"
+	            "new_slackware.servers=172.16.80.118 172.16.80.119\n"
+	            "new_slackware._universe_.servers=2:IA\n"
    ;
 
     struct my_s 
--- tests/test_binary.c	2005-10-20 02:49:46.000000000 -0500
+++ tests/test_binary.c	2005-10-20 02:50:12.000000000 -0500
@@ -48,7 +48,7 @@
 	dhcdbd_log("Filtered QUIT message OK");
 	dbus_svc_quit( dbus );
     }
-    if ( strncmp(interface,"com.redhat.dhcp",15) == 0 )
+    if ( strncmp(interface,"com.slackware.dhcp",15) == 0 )
     {
 	if( strncmp(signature,"y",1) == 0)
 	{
@@ -59,13 +59,13 @@
 		if( ( state != DHC_PREINIT ) && (state != DHC_START) && (state != DHC_END) )
 		{
 		    length=0;
-		    snprintf(dhpath, 1024, "/com/redhat/dhcp/%s", member); 
+		    snprintf(dhpath, 1024, "/com/slackware/dhcp/%s", member); 
 		    msg = dbus_svc_call
 			( dbus,
-			  "com.redhat.dhcp",
+			  "com.slackware.dhcp",
 			  dhpath,
 			  "reason",
-			  "com.redhat.dhcp.text.get",
+			  "com.slackware.dhcp.text.get",
 			  TYPE_INVALID
 			);
 		    if( msg != 0L)
@@ -103,10 +103,10 @@
 		    length=0;
 		    msg = dbus_svc_call
 		    ( dbus,
-		      "com.redhat.dhcp",
+		      "com.slackware.dhcp",
 		      dhpath,
 		      "ip_address",
-		      "com.redhat.dhcp.binary.get",
+		      "com.slackware.dhcp.binary.get",
 		      TYPE_INVALID
 		    );
 		    if( msg != 0L)
@@ -135,10 +135,10 @@
 		    length=0;
 		    msg = dbus_svc_call
 		    ( dbus,
-		      "com.redhat.dhcp",
+		      "com.slackware.dhcp",
 		      dhpath,
 		      "subnet_mask",
-		      "com.redhat.dhcp.binary.get",
+		      "com.slackware.dhcp.binary.get",
 		      TYPE_INVALID
 		    );
 		    if( msg != 0L)
@@ -167,10 +167,10 @@
 		    length=0;
 		    msg = dbus_svc_call
 		    ( dbus,
-		      "com.redhat.dhcp",
+		      "com.slackware.dhcp",
 		      dhpath,
 		      "routers",
-		      "com.redhat.dhcp.binary.get",
+		      "com.slackware.dhcp.binary.get",
 		      TYPE_INVALID
 		    );
 		    if( msg != 0L)
@@ -199,10 +199,10 @@
 		    length=0;
 		    msg = dbus_svc_call
 		    ( dbus,
-		      "com.redhat.dhcp",
+		      "com.slackware.dhcp",
 		      dhpath,
 		      "domain_name",
-		      "com.redhat.dhcp.binary.get",
+		      "com.slackware.dhcp.binary.get",
 		      TYPE_INVALID
 		    );
 		    if( msg != 0L)
@@ -226,10 +226,10 @@
 		    length=0;
 		    msg = dbus_svc_call
 		    ( dbus,
-		      "com.redhat.dhcp",
+		      "com.slackware.dhcp",
 		      dhpath,
 		      "domain_name_servers",
-		      "com.redhat.dhcp.binary.get",
+		      "com.slackware.dhcp.binary.get",
 		      TYPE_INVALID
 		    );
 		    if( msg != 0L)
--- tests/test_prospective_subscriber.c	2005-10-20 02:49:46.000000000 -0500
+++ tests/test_prospective_subscriber.c	2005-10-20 02:50:12.000000000 -0500
@@ -134,7 +134,7 @@
 	dbus_svc_quit( dbus );
     }
 
-    if ( strcmp(interface,"com.redhat.dhcp.subscribe.binary") == 0 )
+    if ( strcmp(interface,"com.slackware.dhcp.subscribe.binary") == 0 )
     {
 	ip_if = strrchr(path, '/');
 	if( ip_if == 0L)
@@ -146,7 +146,7 @@
 */
 	handle_subscription(dbus, ip_if, member, msg);
     }else
-    if ( strcmp(interface,"com.redhat.dhcp.state") == 0 )
+    if ( strcmp(interface,"com.slackware.dhcp.state") == 0 )
 	handle_state_change(dbus, member, msg);
 
     return HANDLED;
@@ -161,14 +161,14 @@
     char subs[1024], path[1024],*option_name;
     dbus_svc_MessageHandle msg;
     
-    sprintf(subs,"com.redhat.dhcp.binary");
-    sprintf(path,"/com/redhat/dhcp/subscribe");
+    sprintf(subs,"com.slackware.dhcp.binary");
+    sprintf(path,"/com/slackware/dhcp/subscribe");
     for(i = 0; i < n_subs; i++)
     {
 	option_name = va_arg(va,char*);
 	msg = dbus_svc_call
 	      ( dbus,
-		"com.redhat.dhcp",
+		"com.slackware.dhcp",
 		path,
 		type,		
 		subs,		
--- tests/test_subscriber.c	2005-10-20 02:49:46.000000000 -0500
+++ tests/test_subscriber.c	2005-10-20 02:50:12.000000000 -0500
@@ -134,7 +134,7 @@
 	dbus_svc_quit( dbus );
     }
 
-    if ( strcmp(interface,"com.redhat.dhcp.subscribe.binary") == 0 )
+    if ( strcmp(interface,"com.slackware.dhcp.subscribe.binary") == 0 )
     {
 	ip_if = strrchr(path, '/');
 	if( ip_if == 0L)
@@ -146,7 +146,7 @@
 */
 	handle_subscription(dbus, ip_if, member, msg);
     }else
-    if ( strcmp(interface,"com.redhat.dhcp.state") == 0 )
+    if ( strcmp(interface,"com.slackware.dhcp.state") == 0 )
 	handle_state_change(dbus, member, msg);
 
     return HANDLED;
@@ -161,14 +161,14 @@
     char subs[1024], path[1024],*option_name;
     dbus_svc_MessageHandle msg;
     
-    sprintf(subs,"com.redhat.dhcp.subscribe");
-    sprintf(path,"/com/redhat/dhcp/%s",ip_if);
+    sprintf(subs,"com.slackware.dhcp.subscribe");
+    sprintf(path,"/com/slackware/dhcp/%s",ip_if);
     for(i = 0; i < n_subs; i++)
     {
 	option_name = va_arg(va,char*);
 	msg = dbus_svc_call
 	      ( dbus,
-		"com.redhat.dhcp",
+		"com.slackware.dhcp",
 		path,
 		type,		
 		subs,		
--- tests/test_subscriber_dbus.c	2005-10-20 02:49:46.000000000 -0500
+++ tests/test_subscriber_dbus.c	2005-10-20 02:50:12.000000000 -0500
@@ -127,7 +127,7 @@
 	dbus_svc_quit( dbus );
     }
 
-    if ( strcmp(interface,"com.redhat.dhcp.subscribe.dbus") == 0 )
+    if ( strcmp(interface,"com.slackware.dhcp.subscribe.dbus") == 0 )
     {
 	ip_if = strrchr(path, '/');
 	if( ip_if == 0L)
@@ -151,14 +151,14 @@
     char subs[1024], path[1024],*option_name;
     dbus_svc_MessageHandle msg;
     
-    sprintf(subs,"com.redhat.dhcp.subscribe");
-    sprintf(path,"/com/redhat/dhcp/%s",ip_if);
+    sprintf(subs,"com.slackware.dhcp.subscribe");
+    sprintf(path,"/com/slackware/dhcp/%s",ip_if);
     for(i = 0; i < n_subs; i++)
     {
 	option_name = va_arg(va,char*);
 	msg = dbus_svc_call
 	      ( dbus,
-		"com.redhat.dhcp",
+		"com.slackware.dhcp",
 		path,
 		type,		
 		subs,		
--- tests/up_down.sh	2005-10-20 02:49:46.000000000 -0500
+++ tests/up_down.sh	2005-10-20 02:50:12.000000000 -0500
@@ -5,17 +5,17 @@
 for (( i=0, b=1; (i < 8) && ( ( i * 8 ) < n) ; i++, b <<=1  )) 
 do 
 if (( (n & b) == b )) ; then 
-   (/usr/bin/dbus-send --system --dest=com.redhat.dhcp --type=method_call --print-reply --reply-timeout=20000 /com/redhat/dhcp/eth0 com.redhat.dhcp.up &);
+   (/usr/bin/dbus-send --system --dest=com.slackware.dhcp --type=method_call --print-reply --reply-timeout=20000 /com/slackware/dhcp/eth0 com.slackware.dhcp.up &);
     kids=(${kids[ ]} $!); 
     echo -n 'UP '; 
 else 
-    (/usr/bin/dbus-send --system --dest=com.redhat.dhcp --type=method_call --print-reply --reply-timeout=20000 /com/redhat/dhcp/eth0 com.redhat.dhcp.down &);
+    (/usr/bin/dbus-send --system --dest=com.slackware.dhcp --type=method_call --print-reply --reply-timeout=20000 /com/slackware/dhcp/eth0 com.slackware.dhcp.down &);
     kids=(${kids[ ]} $!); 
     echo -n 'DOWN '; 
 fi; 
 done; 
 wait ${kids[ ]};
 sleep 4;
-/usr/bin/dbus-send --system --dest=com.redhat.dhcp --type=method_call --print-reply --reply-timeout=20000 /com/redhat/dhcp/eth0 com.redhat.dhcp.up || exit $?;
+/usr/bin/dbus-send --system --dest=com.slackware.dhcp --type=method_call --print-reply --reply-timeout=20000 /com/slackware/dhcp/eth0 com.slackware.dhcp.up || exit $?;
 sleep 4;
-/usr/bin/dbus-send --system --dest=com.redhat.dhcp --type=method_call --print-reply --reply-timeout=20000 /com/redhat/dhcp/eth0 com.redhat.dhcp.down || exit $?;
+/usr/bin/dbus-send --system --dest=com.slackware.dhcp --type=method_call --print-reply --reply-timeout=20000 /com/slackware/dhcp/eth0 com.slackware.dhcp.down || exit $?;
--- client/clparse.c
+++ client/clparse.c
@@ -63,6 +63,7 @@
 	DHO_DOMAIN_NAME,
 	DHO_DOMAIN_NAME_SERVERS,
 	DHO_HOST_NAME,
+	DHO_NTP_SERVERS,
 	0
 };
--- client/dhclient.c.no_isc_blurb	2005-04-18 13:21:08.509169000 -0400
+++ client/dhclient.c	2005-04-18 13:49:27.574402000 -0400
@@ -34,7 +34,7 @@
 static char ocopyright[] =
 "$Id: dhclient.c,v 1.129.2.23 2004/11/24 17:39:14 dhankins Exp $ Copyright (c) 2004 Internet Systems Consortium.  All rights reserved.\n";
 #endif /* not lint */
-
+ 
 #include "dhcpd.h"
 #include "version.h"
 
@@ -81,6 +81,8 @@
 
 void do_release(struct client_state *);
 
+extern int log_isc_blurb;
+
 int main (argc, argv, envp)
 	int argc;
 	char **argv, **envp;
@@ -176,6 +178,7 @@
 		} else if (!strcmp (argv [i], "-q")) {
 			quiet = 1;
 			quiet_interface_discovery = 1;
+			log_isc_blurb = 0;      
 		} else if (!strcmp (argv [i], "-s")) {
 			if (++i == argc)
 				usage ();
--- omapip/errwarn.c.no_isc_blurb	2004-09-30 16:38:32.000000000 -0400
+++ omapip/errwarn.c	2005-04-18 13:45:49.037158000 -0400
@@ -45,6 +45,8 @@
 int log_perror = 1;
 #endif
 int log_priority;
+int log_isc_blurb=0;
+
 void (*log_cleanup) (void);
 
 #define CVT_BUF_MAX 1023
@@ -76,7 +78,9 @@
 	  write (STDERR_FILENO, "\n", 1);
   }
 
-#if !defined (NOMINUM)
+#if !defined(NOMINUM)
+  if ( log_isc_blurb )
+  {
   log_error ("%s", "");
   log_error ("If you did not get this software from ftp.isc.org, please");
   log_error ("get the latest from ftp.isc.org and install that before");
@@ -94,7 +98,12 @@
   log_error ("the README file.");
   log_error ("%s", "");
   log_error ("exiting.");
+  }else
+  {
+      log_error ("exiting.");
+  }
 #endif
+
   if (log_cleanup)
 	  (*log_cleanup) ();
   exit (1);
--- client/scripts/linux	2005-07-24 14:07:56.000000000 -0500
+++ client/scripts/linux	2005-07-24 14:14:21.000000000 -0500
@@ -21,6 +21,26 @@
 
 # 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious
 # of the $1 in its args.
+if [ -n "${dhc_dbus}" ]; then
+   /usr/bin/dbus-send \
+       --system \
+       --dest=com.redhat.dhcp \
+       --type=method_call \
+       /com/redhat/dhcp/$interface \
+       com.redhat.dhcp.set \
+       'string:'"`env | /bin/egrep -v '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`";
+       if (( ( dhc_dbus & 31 ) == 31 )); then
+           exit 0;
+       fi;
+fi;
+
+function save_previous() {
+  if [ -e $1 ]; then
+     /bin/mv $1 $1.predhclient
+  else
+     echo ''> $1.predhclient
+  fi
+}
 
 make_resolv_conf() {
   if [ "x$new_domain_name" != x ] && [ x"$new_domain_name_servers" != x ]; then
--- client/dhclient.c.dhclient_decline_backoff	2005-06-10 13:59:11.000000000 -0400
+++ client/dhclient.c	2005-06-10 14:00:05.000000000 -0400
@@ -707,6 +707,7 @@
 	void *cpp;
 {
 	struct client_state *client = cpp;
+	enum dhcp_state init_state = client -> state;
 
 	ASSERT_STATE(state, S_INIT);
 
@@ -719,9 +720,20 @@
 	client -> first_sending = cur_time;
 	client -> interval = client -> config -> initial_interval;
 
-	/* Add an immediate timeout to cause the first DHCPDISCOVER packet
-	   to go out. */
-	send_discover (client);
+	if ( init_state != S_DECLINED )
+	{
+		/* Add an immediate timeout to cause the first DHCPDISCOVER packet
+		   to go out. */	
+		send_discover (client);
+	}else
+	{
+		/* We've received an OFFER and it has been DECLINEd by dhclient-script.
+		 * wait for a random time between 1 and backoff_cutoff seconds before trying again. 
+		 */
+		add_timeout( cur_time + (( 1 + (random () >> 2) ) %  client -> config -> backoff_cutoff),
+			     send_discover, client, 0, 0
+			   ); 
+	}
 }
 
 /* state_selecting is called when one or more DHCPOFFER packets have been
@@ -994,6 +1006,7 @@
 		send_decline (client);
 		destroy_client_lease (client -> new);
 		client -> new = (struct client_lease *)0;
+		client -> state = S_DECLINED;
 		state_init (client);
 		return;
 	}
--- includes/dhcpd.h.dhclient_decline_backoff	2005-06-10 13:59:11.000000000 -0400
+++ includes/dhcpd.h	2005-06-10 13:59:11.000000000 -0400
@@ -658,7 +658,8 @@
 	S_BOUND = 5,
 	S_RENEWING = 6,
 	S_REBINDING = 7,
-	S_STOPPED = 8
+	S_STOPPED = 8,
+	S_DECLINED= 9
 };
 
 /* Authentication and BOOTP policy possibilities (not all values work
--- client/dhclient.c.dhclient_nodelay	2005-06-10 13:08:50.000000000 -0400
+++ client/dhclient.c	2005-06-10 13:44:19.000000000 -0400
@@ -104,6 +104,7 @@
 	int no_dhclient_db = 0;
 	int no_dhclient_pid = 0;
 	int no_dhclient_script = 0;
+	int n_ips=0;
 	char *s;
 
 	/* Make sure we have stdin, stdout and stderr. */
@@ -504,7 +505,8 @@
 	   Not much entropy, but we're booting, so we're not likely to
 	   find anything better. */
 	seed = 0;
-	for (ip = interfaces; ip; ip = ip -> next) {
+	n_ips=0;
+	for (ip = interfaces; ip; ip = ip -> next, ++n_ips) {
 		int junk;
 		memcpy (&junk,
 			&ip -> hw_address.hbuf [ip -> hw_address.hlen -
@@ -521,10 +523,18 @@
 				do_release (client);
 			else {
 				client -> state = S_INIT;
-				/* Set up a timeout to start the initialization
-				   process. */
-				add_timeout (cur_time + random () % 5,
-					     state_reboot, client, 0, 0);
+				if( n_ips > 1 )
+				{
+					/* Set up a timeout to start the initialization
+					   process. */
+					add_timeout (cur_time + random () % 5,
+						     state_reboot, client, 0, 0);
+				}else
+				{
+					/* Kick off with no delay if only one interface */
+					add_timeout (cur_time, 
+						     state_reboot, client, 0, 0);
+				}
 			}
 		}
 	}
--- client/scripts/linux	2005-07-24 15:05:59.000000000 -0500
+++ client/scripts/linux	2005-07-24 15:18:56.000000000 -0500
@@ -95,13 +95,17 @@
   fi
 
   # We need to give the kernel some time to get the interface up.
-  sleep 1
+  # sleep 1
 
   exit_with_hooks 0
 fi
 
 if [ x$reason = xARPCHECK ] || [ x$reason = xARPSEND ]; then
-  exit_with_hooks 0
+   if [ -z "$new_ip_address" ] || [ -z "$interface" ] || /sbin/arping -q -c 2 -w 3 -D -I ${interface} ${new_ip_address}; then
+      exit_with_hooks 0
+   else
+      exit_with_hooks 1
+   fi;
 fi
   
 if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
--- common/parse.c.extended_option_environment	2005-04-05 17:49:36.513062562 -0400
+++ common/parse.c	2005-04-05 17:49:36.580052656 -0400
@@ -1270,6 +1270,10 @@
 	option_hash_add (option -> universe -> hash,
 			 (const char *)option -> name,
 			 0, option, MDL);
+#ifdef EXTENDED_NEW_OPTION_INFO
+	if ( new_option_info_tree != 0L )
+		add_new_option_info( option );
+#endif
 	return 1;
 }
 
--- common/tables.c.extended_option_environment	2004-09-01 13:06:35.000000000 -0400
+++ common/tables.c	2005-04-05 18:04:23.915838623 -0400
@@ -1238,3 +1238,40 @@
 			   fqdn_universe.name, 0,
 			   &fqdn_universe, MDL);
 }
+
+#ifdef EXTENDED_NEW_OPTION_INFO
+#include <search.h>
+
+void *new_option_info_tree = 0L;
+
+static int  new_option_info_comparator( const void* p1, const void *p2 )
+{
+	uint32_t ocode1 =  (((const struct option*)p1)->universe->index << 8)
+		          |(((const struct option*)p1)->code),
+		 ocode2 =  (((const struct option*)p2)->universe->index << 8)
+	                  |(((const struct option*)p2)->code);
+	return( (ocode1 == ocode2) 
+		? 0 
+		:( ( ocode1 > ocode2 )
+		   ?  1
+		   : -1
+	         )
+	      );
+}
+
+void *add_new_option_info( struct option *option )
+{
+	if ( option->universe->index >= fqdn_universe.index )
+		return 0L;
+	if ( new_option_info_tree == GENERATE_NEW_OPTION_INFO )
+		new_option_info_tree = (void*)0L;
+	return tsearch( option, &(new_option_info_tree), new_option_info_comparator );
+}
+
+void *lookup_new_option_info( struct option *option )
+{
+	if ( new_option_info_tree == GENERATE_NEW_OPTION_INFO )
+		return 0L;
+	return tfind( option, &(new_option_info_tree), new_option_info_comparator );
+}
+#endif
--- includes/dhcpd.h.extended_option_environment	2004-11-24 12:39:16.000000000 -0500
+++ includes/dhcpd.h	2005-04-05 17:49:36.613047777 -0400
@@ -1800,6 +1800,14 @@
 void initialize_common_option_spaces PROTO ((void));
 struct universe *config_universe;
 
+#define EXTENDED_NEW_OPTION_INFO
+#ifdef EXTENDED_NEW_OPTION_INFO
+#define GENERATE_NEW_OPTION_INFO ((void*)1)
+extern void   *new_option_info_tree;
+extern void   *add_new_option_info( struct option*);
+extern void   *lookup_new_option_info( struct option *);
+#endif
+
 /* stables.c */
 #if defined (FAILOVER_PROTOCOL)
 extern failover_option_t null_failover_option;
--- client/dhclient.c.extended_option_environment	2005-04-05 17:49:36.566054726 -0400
+++ client/dhclient.c	2005-04-05 17:49:36.617047185 -0400
@@ -74,7 +74,9 @@
 int onetry=0;
 int quiet=0;
 int nowait=0;
-
+#ifdef EXTENDED_NEW_OPTION_INFO
+int extended_option_environment = 0;
+#endif
 static void usage PROTO ((void));
 
 void do_release(struct client_state *);
@@ -204,6 +206,11 @@
 		} else if (!strcmp (argv [i], "--version")) {
 			log_info ("isc-dhclient-%s", DHCP_VERSION);
 			exit (0);
+#ifdef EXTENDED_NEW_OPTION_INFO
+		} else if (!strcmp (argv [i], "-x")) {
+		    extended_option_environment = 1;
+		    new_option_info_tree = GENERATE_NEW_OPTION_INFO;
+#endif
  		} else if (argv [i][0] == '-') {
  		    usage ();
 		} else {
@@ -572,7 +579,11 @@
 	log_info (arr);
 	log_info (url);
 
+#ifdef EXTENDED_NEW_OPTION_INFO
+	log_error ("Usage: dhclient [-1dqr] [-nwx] [-p <port>] %s",
+#else
 	log_error ("Usage: dhclient [-1dqr] [-nw] [-p <port>] %s",
+#endif
 		   "[-s server]");
 	log_error ("                [-cf config-file] [-lf lease-file]%s",
 		   "[-pf pid-file] [-e VAR=val]");
@@ -2529,8 +2540,28 @@
 struct envadd_state {
 	struct client_state *client;
 	const char *prefix;
+        struct universe *universe;
 };
 
+#ifdef EXTENDED_NEW_OPTION_INFO			
+static 
+void build_universe_info_envvar
+(      struct option_cache *oc,
+       struct packet *p, struct lease *l,
+       struct client_state *client,
+       struct option_state *in_o,
+       struct option_state *cf_o,
+       struct binding_scope **scope,
+       struct universe *u, void *es	          
+)
+{
+    char info_name[512], info_data[512];
+    snprintf(info_name, 512, "%s._universe_.", oc->option->universe->name);
+    snprintf(info_data, 512, "%u:%s", oc->option->code,oc->option->format);
+    client_envadd( client, info_name, oc->option->name, info_data );
+}
+#endif
+
 void client_option_envadd (struct option_cache *oc,
 			   struct packet *packet, struct lease *lease,
 			   struct client_state *client_state,
@@ -2547,6 +2578,31 @@
 				   in_options, cfg_options, scope, oc, MDL)) {
 		if (data.len) {
 			char name [256];
+#ifdef EXTENDED_NEW_OPTION_INFO			
+			if (  extended_option_environment )
+			{
+				if(  ( oc->option->universe != &dhcp_universe )
+				   &&( oc->option->universe->index > fqdn_universe.index )
+				   &&( es->universe !=  oc->option->universe )
+			          )
+				{
+					es->universe = oc->option->universe;
+					(*(es->universe->foreach))
+					     (  (struct packet *)0, (struct lease *)0, 
+						client_state, 
+						in_options, cfg_options, 
+						scope, es->universe, es, 
+						build_universe_info_envvar
+					     );
+				}else
+				if ( lookup_new_option_info(oc->option) != 0L )			   
+					build_universe_info_envvar
+					      ( oc, packet, lease, client_state, 
+						in_options, cfg_options, scope,
+						oc->option->universe, es 
+					      );
+			}
+#endif
 			if (dhcp_option_ev_name (name, sizeof name,
 						 oc -> option)) {
 				client_envadd (es -> client, es -> prefix,
@@ -2575,6 +2631,7 @@
 
 	es.client = client;
 	es.prefix = prefix;
+	es.universe = 0L;
 
 	client_envadd (client,
 		       prefix, "ip_address", "%s", piaddr (lease -> address));
@@ -2788,7 +2845,14 @@
 			s = option -> name;
 			if (j + 1 == buflen)
 				return 0;
+#ifdef EXTENDED_NEW_OPTION_INFO
+			if ( ! extended_option_environment )
+			    buf [j++] = '_';
+			else
+			    buf [j++] = '.';
+#else
 			buf [j++] = '_';
+#endif
 		}
 		++i;
 	} while (i != 2);
--- client/dhclient.8.extended_option_environment	2004-09-29 19:01:46.000000000 -0400
+++ client/dhclient.8	2005-04-05 17:49:36.619046889 -0400
@@ -78,6 +78,9 @@
 .B -w
 ]
 [
+.B -x
+]
+[
 .I if0
 [
 .I ...ifN
@@ -259,6 +262,10 @@
 supplying the
 .B -nw
 flag.
+.PP
+The -x argument enables eXtended option information to be created in the
+-s dhclient-script environment, which would allow applications running 
+in that environment to handle options they do not know about in advance.
 .SH CONFIGURATION
 The syntax of the dhclient.conf(5) file is discussed separately.
 .SH OMAPI
--- client/scripts/linux	2005-08-06 07:32:49.000000000 -0500
+++ client/scripts/linux	2005-08-06 07:33:25.000000000 -0500
@@ -24,10 +24,10 @@
 if [ -n "${dhc_dbus}" ]; then
    /usr/bin/dbus-send \
        --system \
-       --dest=com.redhat.dhcp \
+       --dest=com.slackware.dhcp \
        --type=method_call \
-       /com/redhat/dhcp/$interface \
-       com.redhat.dhcp.set \
+       /com/slackware/dhcp/$interface \
+       com.slackware.dhcp.set \
        'string:'"`env | /bin/egrep -v '^(PATH|SHLVL|_|PWD|dhc_dbus)\='`";
        if (( ( dhc_dbus & 31 ) == 31 )); then
            exit 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]