]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Allow hardware type to be specified in the ClientID. This is needed, as the ethernet...
authorRoy Marples <roy@marples.name>
Tue, 5 Feb 2008 21:38:00 +0000 (21:38 +0000)
committerRoy Marples <roy@marples.name>
Tue, 5 Feb 2008 21:38:00 +0000 (21:38 +0000)
client.c
dhcpcd.8.in

index f52886bb6531b8cb29267834baf9ece84d2fda4c..aa8d709aba5c4181ffbeeb6aae551d5913502850 100644 (file)
--- a/client.c
+++ b/client.c
@@ -373,30 +373,13 @@ static bool client_setup (state_t *state, const options_t *options)
        }
 
        if (*options->clientid) {
-               uint8_t family = 0;
                /* Attempt to see if the ClientID is a hardware address */
                iface->clientid_len = hwaddr_aton (NULL, options->clientid);
-
-               /* We need to at least try and guess the family */
-               switch (iface->clientid_len) {
-                       case ETHER_ADDR_LEN:
-                               family = ARPHRD_ETHER;
-                               break;
-                       case EUI64_ADDR_LEN:
-                               family = ARPHRD_IEEE1394;
-                               break;
-                       case INFINIBAND_ADDR_LEN:
-                               family = ARPHRD_INFINIBAND;
-                               break;
-               }
-
-               /* It looks and smells like one, so make it one */
-               if (family) {
-                       iface->clientid_len += 1;
+               if (iface->clientid_len) {
                        iface->clientid = xmalloc (iface->clientid_len);
-                       *iface->clientid =  family;
-                       hwaddr_aton (iface->clientid + 1, options->clientid);
+                       hwaddr_aton (iface->clientid, options->clientid);
                } else {
+                       /* Nope, so mark it as-is */
                        iface->clientid_len = strlen (options->clientid) + 1;
                        iface->clientid = xmalloc (iface->clientid_len);
                        *iface->clientid = '\0';
index ed3b41378820f676e7abdc3e63754b419e3a19c2..0ff37a0ca05ef4e94c256bee2b2f3833380aaf54 100644 (file)
@@ -256,8 +256,14 @@ Send
 .Ar clientid
 as a client identifier string. If
 .Ar clientid
-matches a hardware address format, such as 00:01:02:03:04:05 then we encode
-it as that, otherwise as a string.
+matches a hardware address format, such as 01:00:01:02:03:04:05 then we encode
+it as that, otherwise as a string. You need to specify the hardware type in
+the first byte. Ethernet is 01, and the hardware address in the example is
+00:01:02:03:04:05. If the
+.Ar clientid
+is a blank string, then we disable DUID support and use a
+.Ar clientid
+as shown above.
 .It Fl S, -mscsr
 Microsoft have their own code for Classless Static Routes
 .Po