dhcp: Use chunk_hash_static() to calculate ID-based MAC addresses
authorTobias Brunner <tobias@strongswan.org>
Fri, 28 Jun 2013 10:22:56 +0000 (12:22 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 28 Jun 2013 15:00:29 +0000 (17:00 +0200)
src/libcharon/plugins/dhcp/dhcp_socket.c
testing/tests/ikev2/dhcp-static-mac/hosts/venus/etc/dhcp/dhcpd.conf
testing/tests/ikev2/dhcp-static-mac/hosts/venus/etc/dnsmasq.conf

index 46d4c64..72e6ff4 100644 (file)
@@ -227,7 +227,7 @@ static int prepare_dhcp(private_dhcp_socket_t *this,
        /* with ID specific postfix */
        if (this->identity_lease)
        {
-               id = htonl(chunk_hash(chunk));
+               id = htonl(chunk_hash_static(chunk));
        }
        else
        {
index cdade2f..97c5efa 100644 (file)
@@ -14,11 +14,11 @@ subnet 10.1.0.0 netmask 255.255.0.0 {
 }
 
 host carol {
-  hardware ethernet            7a:a7:8f:fc:db:3b;
+  hardware ethernet            7a:a7:51:cc:22:4a;
   fixed-address                10.1.0.30;
 }
 
 host dave {
-  hardware ethernet            7a:a7:35:78:bc:85;
+  hardware ethernet            7a:a7:93:70:2b:21;
   fixed-address                10.1.0.40;
 }
index 61d31a0..ed28c69 100644 (file)
@@ -1,7 +1,7 @@
 interface=eth0
 dhcp-range=10.1.0.50,10.1.0.60,255.255.0.0,10.1.255.255
-dhcp-host=7a:a7:8f:fc:db:3b,10.1.0.30
-dhcp-host=7a:a7:35:78:bc:85,10.1.0.40
+dhcp-host=7a:a7:51:cc:22:4a,10.1.0.30
+dhcp-host=7a:a7:93:70:2b:21,10.1.0.40
 dhcp-option=option:router,PH_IP_MOON1
 dhcp-option=option:dns-server,PH_IP_VENUS
 dhcp-option=option:netbios-ns,PH_IP_ALICE