]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
We no longer send a ClientID by default. This is so we now mirror the kernel DHCP...
authorRoy Marples <roy@marples.name>
Mon, 17 Nov 2008 17:25:54 +0000 (17:25 +0000)
committerRoy Marples <roy@marples.name>
Mon, 17 Nov 2008 17:25:54 +0000 (17:25 +0000)
README
dhcpcd.8.in
dhcpcd.c
dhcpcd.conf.5.in
if-options.c

diff --git a/README b/README
index f80c330c5fe612445226d00d7099a5ed4fd9bc14..86ee1848232ad6ae8e28c8ad6b0c4707a00fb108 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-dhcpcd-4 - DHCP client daemon
+dhcpcd - DHCP client daemon
 Copyright 2006-2008 Roy Marples <roy@marples.name>
 
 
@@ -43,9 +43,13 @@ make HOOKSCRIPTS=50-ntp install
 
 Compatibility
 -------------
-dhcpcd-4.1 is only fully command line compatible with dhcpcd-4.0
+dhcpcd-5.0 is only fully command line compatible with dhcpcd-4.0
 For compatibility with older versions, use dhcpcd-4.0
 
+dhcpcd no longer sends a default ClientID for ethernet interfaces.
+This is so we can re-use the address the kernel DHCP client found.
+To retain the old behaviour of sending a default ClientID based on the
+hardware address for interface, simply add the keyword clientid to dhcpcd.conf.
 
 ChangeLog
 ---------
index 2375933b2b5195eabe41c35ecb598ae31b1ca8ee..13fd07e262fdc886c79ff7fbc6e524b5a1878951 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd October 07, 2008
+.Dd November 17, 2008
 .Dt DHCPCD 8 SMM
 .Sh NAME
 .Nm dhcpcd
@@ -351,9 +351,11 @@ itself never does any DNS updates.
 encodes the FQDN hostname as specified in
 .Li RFC1035 .
 .It Fl I , -clientid Ar clientid
-Change the default clientid sent from the interface hardware address.
+Send the
+.Ar clientid .
 If the string is of the format 01:02:03 then it is encoded as hex.
-If not set then none is sent.
+For interfaces whose hardware address is longer than 8 bytes we send a default
+clientid of the hardware family and the hardware address.
 .El
 .Ss Restriciting behaviour
 .Nm
@@ -474,8 +476,4 @@ does not wait for commands to complete when sending them to the master
 .Nm
 process.
 .Pp
-One of the goals for one instance managing multiple interfaces is more
-intelligent route and configuration management.
-This has not yet been done.
-.Pp
 Please report them to http://roy.marples.name/projects/dhcpcd
index 9cec64039755b75af2044915fb05f32737c3f95a..27973ec00a792b88bb70b07a0a8117d5c6f1af7e 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -857,6 +857,12 @@ configure_interface(struct interface *iface, int argc, char **argv)
        if (ifo->metric != -1)
                iface->metric = ifo->metric;
 
+       /* If we haven't specified a ClientID and our hardware address
+        * length is greater than DHCP_CHADDR_LEN then we enforce a ClientID
+        * of the hardware address family and the hardware address. */
+       if (!(ifo->options & DHCPCD_CLIENTID) && iface->hwlen > DHCP_CHADDR_LEN)
+               ifo->options |= DHCPCD_CLIENTID;
+
        free(iface->clientid);
        if (*ifo->clientid) {
                iface->clientid = xmalloc(ifo->clientid[0] + 1);
index d6e9d29da4cad5a347ccb1052b8db28d81cd0dba..90b2c1bab3a138eaa734fc3ec83ba7dc500986c2 100644 (file)
@@ -22,7 +22,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd October 07, 2008
+.Dd November 17, 2008
 .Dt DHCPCD.CONF 5 SMM
 .Sh NAME
 .Nm dhcpcd.conf
@@ -61,9 +61,11 @@ Background immediately.
 This is useful for startup scripts which don't disable link messages for
 carrier status.
 .It Ic clientid Ar string
-Change the default clientid sent from the interface hardware address.
+Send the
+.Ar clientid .
 If the string is of the format 01:02:03 then it is encoded as hex.
-If not set then none is sent.
+For interfaces whose hardware address is longer than 8 bytes we send a default
+clientid of the hardware family and the hardware address.
 .It Ic duid
 Generate an
 .Rs
index 24bf5ad363aa1385d3f0a42d44ee78731aa8a407..6d031295cc1460c9b1e91f4d258a4a8dc293fefe 100644 (file)
@@ -467,7 +467,7 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                free(p);
                break;
        case 'D':
-               ifo->options |= DHCPCD_DUID;
+               ifo->options |= DHCPCD_CLIENTID | DHCPCD_DUID;
                break;
        case 'E':
                ifo->options |= DHCPCD_LASTLEASE;
@@ -505,11 +505,8 @@ parse_option(struct if_options *ifo, int opt, const char *arg)
                        syslog(LOG_ERR, "clientid: %m");
                        return -1;
                }
+               ifo->options |= DHCPCD_CLIENTID;
                ifo->clientid[0] = (uint8_t)s;
-               if (s == 0) {
-                       ifo->options &= ~DHCPCD_DUID;
-                       ifo->options &= ~DHCPCD_CLIENTID;
-               }
                break;
        case 'K':
                ifo->options &= ~DHCPCD_LINK;
@@ -591,7 +588,7 @@ read_config(const char *file, const char *ifname)
 
        /* Seed our default options */
        ifo = xzalloc(sizeof(*ifo));
-       ifo->options |= DHCPCD_CLIENTID | DHCPCD_GATEWAY | DHCPCD_DAEMONISE;
+       ifo->options |= DHCPCD_GATEWAY | DHCPCD_DAEMONISE;
        ifo->options |= DHCPCD_ARP | DHCPCD_IPV4LL | DHCPCD_LINK;
        ifo->timeout = DEFAULT_TIMEOUT;
        ifo->reboot = DEFAULT_REBOOT;