[Babel-users] ahcp prefix delegation

Juliusz Chroboczek Juliusz.Chroboczek at pps.jussieu.fr
Fri Nov 13 21:55:12 UTC 2009


>>> wonderful, thats exacly what i need, also for ipv6.

I've just pushed very basic client-side support for prefix delegation
into the Darcs repository.  It's completely untested, so you'll most
likely need to do some debugging on your side.

  darcs get http://www.pps.jussieu.fr/~jch/software/repos/ahcpd

You use it by passing -P to the client.  If prefix delegation is
successful, it will pass one or both of AHCP_IPv4_PREFIX_DELEGATION
or AHCP_IPv6_PREFIX_DELEGATION to the config script; you'll most likely
want to do something smart in /etc/ahcp/ahcp-local.sh with it.

To do:

  * test;
  * pick the lease with prefix delegation (currently it marks prefix
    delegation as optional, and just takes the first lease offer,
    whether it offers prefix delegation or not);
  * allow choosing the prefix length (the protocol allows that, but it's
    not implemented);
  * allow requesting just IPv4, just IPv6, or both (currently, both IPv4
    and IPv6 are requested when -P is used).

The server-side code is not ready yet -- in particular, I'm not quite
sure what the right configuration is, do we want dynamic leases on
prefixes, or do we want static leases that depend on the requestor's
unique id?  For the time being, I'm appending a very stupid patch that
simply delegates the same prefix to all clients, whether they actually
requested prefix delegation or not.

You'll want to compile that with

  make EXTRA_DEFINES=-DHORRIBLE_HACK_FOR_ALEXANDER

Let me know if you have clear ideas about how to do the server side.

                                        Juliusz

diff -rN -u old-ahcpd/config.c new-ahcpd/config.c
--- old-ahcpd/config.c  2009-11-13 22:48:15.340709225 +0100
+++ new-ahcpd/config.c  2009-11-13 22:48:15.348710946 +0100
@@ -887,6 +887,18 @@
         }
     }
 
+#ifdef HORRIBLE_HACK_FOR_ALEXANDER
+#warning Using horrible hack for Alexander
+    {
+        const unsigned char prefix[5] = {192, 168, 123, 0, 24};
+        buf[i++] = OPT_IPv4_PREFIX_DELEGATION; if(i >= buflen) goto
fail;
+        buf[i++] = 5; if(i >= buflen) goto fail;
+        if(i >= buflen - 5) goto fail;
+        memcpy(buf + i, prefix, 5);
+        i += 5;
+    }
+#endif
+
     /* Set up header */
     j = i - 4;
     buf[0] = opcode;



More information about the Babel-users mailing list