From 0300fe7589a1701361735ac068e4b57bb1a1896f Mon Sep 17 00:00:00 2001 From: Steven Barth Date: Mon, 25 Aug 2014 08:08:56 +0200 Subject: [PATCH] Enable softwire-support by default --- CMakeLists.txt | 4 ---- README | 6 +++--- src/dhcpv6.c | 4 ---- src/odhcp6c.h | 20 +++++++++----------- src/script.c | 8 ++------ 5 files changed, 14 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9e508f1..f85334c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,10 +15,6 @@ if(${EXT_CER_ID}) add_definitions(-DEXT_CER_ID=${EXT_CER_ID}) endif(${EXT_CER_ID}) -if(${EXT_S46}) - add_definitions(-DEXT_S46=${EXT_S46}) -endif(${EXT_S46}) - add_executable(odhcp6c src/odhcp6c.c src/dhcpv6.c src/ra.c src/script.c src/md5.c) target_link_libraries(odhcp6c resolv) diff --git a/README b/README index f9abd49..91cefc0 100644 --- a/README +++ b/README @@ -28,9 +28,9 @@ especially routers. It compiles to only about 30 KB (-Os -s). g) Information-Refresh Options h) Configurable SOL_MAX_RT i) DS-Lite AFTR-Name Option - j) Prefix Class (experimental) - k) CER-ID (experimental) - l) Softwire address and port mapped clients (experimental) + j) Softwire address and port mapped clients (MAP, LW4over6) + k) Prefix Class (experimental) + l) CER-ID (experimental) 4. Support for requesting and parsing Router Advertisements a) parsing of prefixes, routes, MTU and RDNSS options diff --git a/src/dhcpv6.c b/src/dhcpv6.c index aafd237..b7fccac 100644 --- a/src/dhcpv6.c +++ b/src/dhcpv6.c @@ -179,11 +179,9 @@ int init_dhcpv6(const char *ifname, unsigned int options, int sol_timeout) #ifdef EXT_CER_ID htons(DHCPV6_OPT_CER_ID), #endif -#ifdef EXT_S46 htons(DHCPV6_OPT_S46_CONT_MAPE), htons(DHCPV6_OPT_S46_CONT_MAPT), htons(DHCPV6_OPT_S46_CONT_LW), -#endif }; odhcp6c_add_state(STATE_ORO, oro, sizeof(oro)); } @@ -1041,7 +1039,6 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, _unused const int rc, odhcp6c_add_state(STATE_CER, &cer_id->addr, sizeof(any)); passthru = false; #endif -#ifdef EXT_S46 } else if (otype == DHCPV6_OPT_S46_CONT_MAPT) { odhcp6c_add_state(STATE_S46_MAPT, odata, olen); passthru = false; @@ -1054,7 +1051,6 @@ static int dhcpv6_handle_reply(enum dhcpv6_msg orig, _unused const int rc, } else if (otype == DHCPV6_OPT_S46_CONT_LW) { odhcp6c_add_state(STATE_S46_LW, odata, olen); passthru = false; -#endif } else if (otype == DHCPV6_OPT_CLIENTID || otype == DHCPV6_OPT_SERVERID || otype == DHCPV6_OPT_IA_TA || diff --git a/src/odhcp6c.h b/src/odhcp6c.h index 01fb072..59c4a42 100644 --- a/src/odhcp6c.h +++ b/src/odhcp6c.h @@ -73,17 +73,15 @@ enum dhcvp6_opt { /* draft-donley-dhc-cer-id-option-03 */ DHCPV6_OPT_CER_ID = EXT_CER_ID, #endif -#ifdef EXT_S46 - /* draft-ietf-softwire-map-dhcp-07 */ - DHCPV6_OPT_S46_RULE = EXT_S46, - DHCPV6_OPT_S46_BR = EXT_S46 + 1, - DHCPV6_OPT_S46_DMR = EXT_S46 + 2, - DHCPV6_OPT_S46_V4V6BIND = EXT_S46 + 3, - DHCPV6_OPT_S46_PORTPARAMS = EXT_S46 + 4, - DHCPV6_OPT_S46_CONT_MAPE = EXT_S46 + 5, - DHCPV6_OPT_S46_CONT_MAPT = EXT_S46 + 6, - DHCPV6_OPT_S46_CONT_LW = EXT_S46 + 7, -#endif + /* draft-ietf-softwire-map-dhcp-08 */ + DHCPV6_OPT_S46_RULE = 89, + DHCPV6_OPT_S46_BR = 90, + DHCPV6_OPT_S46_DMR = 91, + DHCPV6_OPT_S46_V4V6BIND = 92, + DHCPV6_OPT_S46_PORTPARAMS = 93, + DHCPV6_OPT_S46_CONT_MAPE = 94, + DHCPV6_OPT_S46_CONT_MAPT = 95, + DHCPV6_OPT_S46_CONT_LW = 96, }; enum dhcpv6_opt_npt { diff --git a/src/script.c b/src/script.c index 389dc37..d443ede 100644 --- a/src/script.c +++ b/src/script.c @@ -209,7 +209,7 @@ static void entry_to_env(const char *name, const void *data, size_t len, enum en putenv(buf); } -#ifdef EXT_S46 + static void s46_to_env_portparams(const uint8_t *data, size_t len, FILE *fp) { uint8_t *odata; @@ -223,7 +223,7 @@ static void s46_to_env_portparams(const uint8_t *data, size_t len, FILE *fp) } } } -#endif + static void s46_to_env(enum odhcp6c_state state, const uint8_t *data, size_t len) { @@ -237,7 +237,6 @@ static void s46_to_env(enum odhcp6c_state state, const uint8_t *data, size_t len fputs(name, fp); fputc('=', fp); -#ifdef EXT_S46 const char *type = (state == STATE_S46_MAPE) ? "map-e" : (state == STATE_S46_MAPT) ? "map-t" : "lw4o6"; @@ -327,9 +326,6 @@ static void s46_to_env(enum odhcp6c_state state, const uint8_t *data, size_t len fputc(' ', fp); } -#else - if (data && len) {} -#endif fclose(fp); putenv(str); -- 2.25.1