From c34d1518eb446d596087ed2b9dda33a513f7e980 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Tue, 19 Jul 2016 17:49:50 +0100 Subject: [ipv6] Create routing table based on IPv6 settings Use the IPv6 settings to construct the routing table, in a matter analogous to the construction of the IPv4 routing table. This allows for manual assignment of IPv6 addresses via e.g. set net0/ip6 2001:ba8:0:1d4::6950:5845 set net0/len6 64 set net0/gateway6 fe80::226:bff:fedd:d3c0 The prefix length ("len6") may be omitted, in which case a default prefix length of 64 will be assumed. Multiple IPv6 addresses may be assigned manually by implicitly creating child settings blocks. For example: set net0/ip6 2001:ba8:0:1d4::6950:5845 set net0.ula/ip6 fda4:2496:e992::6950:5845 Signed-off-by: Michael Brown --- src/net/udp/dhcpv6.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'src/net/udp') diff --git a/src/net/udp/dhcpv6.c b/src/net/udp/dhcpv6.c index a2c69aaae..253032e4e 100644 --- a/src/net/udp/dhcpv6.c +++ b/src/net/udp/dhcpv6.c @@ -462,8 +462,6 @@ enum dhcpv6_session_state_flags { DHCPV6_RX_RECORD_SERVER_ID = 0x04, /** Record received IPv6 address */ DHCPV6_RX_RECORD_IAADDR = 0x08, - /** Apply received IPv6 address */ - DHCPV6_RX_APPLY_IAADDR = 0x10, }; /** DHCPv6 request state */ @@ -471,7 +469,7 @@ static struct dhcpv6_session_state dhcpv6_request = { .tx_type = DHCPV6_REQUEST, .rx_type = DHCPV6_REPLY, .flags = ( DHCPV6_TX_IA_NA | DHCPV6_TX_IAADDR | - DHCPV6_RX_RECORD_IAADDR | DHCPV6_RX_APPLY_IAADDR ), + DHCPV6_RX_RECORD_IAADDR ), .next = NULL, }; @@ -870,19 +868,6 @@ static int dhcpv6_rx ( struct dhcpv6_session *dhcpv6, dhcpv6->server_duid_len ); } - /* Apply identity association address, if applicable */ - if ( dhcpv6->state->flags & DHCPV6_RX_APPLY_IAADDR ) { - if ( ( rc = ipv6_set_address ( dhcpv6->netdev, - &dhcpv6->lease ) ) != 0 ) { - DBGC ( dhcpv6, "DHCPv6 %s could not apply %s: %s\n", - dhcpv6->netdev->name, - inet6_ntoa ( &dhcpv6->lease ), strerror ( rc ) ); - /* This is plausibly the error we want to return */ - dhcpv6->rc = rc; - goto done; - } - } - /* Transition to next state, if applicable */ if ( dhcpv6->state->next ) { dhcpv6_set_state ( dhcpv6, dhcpv6->state->next ); -- cgit v1.2.3-55-g7522