changeset 18:a43748f6c97d draft

Revert mistaken commit
author Roy Marples <roy@marples.name>
date Tue, 05 Dec 2006 10:12:50 +0000
parents 615b5b71bdc3
children d1c15501fd5e
files ChangeLog dhcp.c
diffstat 2 files changed, 31 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Dec 05 09:42:35 2006 +0000
+++ b/ChangeLog	Tue Dec 05 10:12:50 2006 +0000
@@ -1,6 +1,6 @@
 dhcpcd-3.0.3
 NIS setup (yp.conf / domainname) works again.
-Send hostname/fqdn and our parameter list in DISCOVER and INFORM messages too.
+Send hostname/fqdn in DISCOVER and INFORM messages too.
 Add more debug messages.
 Fix writing to resolv.conf when resolvconf not present.
 Include linux/if_addr.h for 2.6.19+ kernels, thanks to AlexExtreme.
--- a/dhcp.c	Tue Dec 05 09:42:35 2006 +0000
+++ b/dhcp.c	Tue Dec 05 10:12:50 2006 +0000
@@ -153,27 +153,36 @@
       n_params = p;
       *p++ = 0;
 
-      *p++ = DHCP_RENEWALTIME;
-      *p++ = DHCP_REBINDTIME;
-      *p++ = DHCP_NETMASK;
-      *p++ = DHCP_BROADCAST;
-      *p++ = DHCP_CSR;
-      /* RFC 3442 states classless static routes should be before routers
-       * and static routes as classless static routes override them both */
-      *p++ = DHCP_ROUTERS;
-      *p++ = DHCP_STATICROUTE;
-      *p++ = DHCP_HOSTNAME;
-      *p++ = DHCP_DNSSEARCH;
-      *p++ = DHCP_DNSDOMAIN;
-      *p++ = DHCP_DNSSERVER;
-      *p++ = DHCP_NISDOMAIN;
-      *p++ = DHCP_NISSERVER;
-      *p++ = DHCP_NTPSERVER;
-      /* These parameters were requested by dhcpcd-2.0 and earlier
-	 but we never did anything with them */
-      /*    *p++ = DHCP_DEFAULTIPTTL;
-       *p++ = DHCP_MASKDISCOVERY;
-       *p++ = DHCP_ROUTERDISCOVERY; */
+      /* Only request DNSSERVER in discover to keep the packets small.
+	 RFC2131 Section 3.5 states that the REQUEST must include the list
+	 from the DISCOVER message, so I think we can safely do this. */
+
+      if (type == DHCP_DISCOVER)
+	*p++ = DHCP_DNSSERVER;
+      else
+	{
+	  *p++ = DHCP_RENEWALTIME;
+	  *p++ = DHCP_REBINDTIME;
+	  *p++ = DHCP_NETMASK;
+	  *p++ = DHCP_BROADCAST;
+	  *p++ = DHCP_CSR;
+	  /* RFC 3442 states classless static routes should be before routers
+	   * and static routes as classless static routes override them both */
+	  *p++ = DHCP_ROUTERS;
+	  *p++ = DHCP_STATICROUTE;
+	  *p++ = DHCP_HOSTNAME;
+	  *p++ = DHCP_DNSSEARCH;
+	  *p++ = DHCP_DNSDOMAIN;
+	  *p++ = DHCP_DNSSERVER;
+	  *p++ = DHCP_NISDOMAIN;
+	  *p++ = DHCP_NISSERVER;
+	  *p++ = DHCP_NTPSERVER;
+	  /* These parameters were requested by dhcpcd-2.0 and earlier
+	     but we never did anything with them */
+	  /*    *p++ = DHCP_DEFAULTIPTTL;
+	   *p++ = DHCP_MASKDISCOVERY;
+	   *p++ = DHCP_ROUTERDISCOVERY; */
+	}
 
       *n_params = p - n_params - 1;