]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Revert mistaken commit
authorRoy Marples <roy@marples.name>
Tue, 5 Dec 2006 10:12:50 +0000 (10:12 +0000)
committerRoy Marples <roy@marples.name>
Tue, 5 Dec 2006 10:12:50 +0000 (10:12 +0000)
ChangeLog
dhcp.c

index 545f128cfe52b34d16802a83e5eb215eaeb19e54..7165c3ade8ddb9cb8130be2f6e52efb4d74abf1b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/dhcp.c b/dhcp.c
index c765fe224261d3c224b8948ae2b489e3ebe4f6d3..fbf5389d464345d99a00afec021ee5454e4ae58f 100644 (file)
--- a/dhcp.c
+++ b/dhcp.c
@@ -153,27 +153,36 @@ size_t send_message (interface_t *iface, dhcp_t *dhcp,
       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;