From c700bd6c31878c17ce51f4a3f0b7e060d1db3df0 Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Sun, 28 Aug 2011 23:01:32 +0400 Subject: ipv6_dhcp: use NoPrefixAvail instead of NoAddrsAvail for IA_PD --- accel-pppd/ipv6/dhcpv6.c | 5 ++++- accel-pppd/ipv6/dhcpv6.h | 1 + accel-pppd/ipv6/dhcpv6_packet.c | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/accel-pppd/ipv6/dhcpv6.c b/accel-pppd/ipv6/dhcpv6.c index edbc225c..a8302222 100644 --- a/accel-pppd/ipv6/dhcpv6.c +++ b/accel-pppd/ipv6/dhcpv6.c @@ -255,7 +255,7 @@ static void dhcpv6_send_reply(struct dhcpv6_packet *req, struct dhcpv6_pd *pd, i } else if (!pd->ipv6_dp || list_empty(&pd->ipv6_dp->prefix_list) || f2) { opt3 = dhcpv6_nested_option_alloc(reply, opt1, D6_OPTION_STATUS_CODE, sizeof(struct dhcpv6_opt_status) - sizeof(struct dhcpv6_opt_hdr)); status = (struct dhcpv6_opt_status *)opt3->hdr; - status->code = htons(D6_STATUS_NoAddrsAvail); + status->code = htons(D6_STATUS_NoPrefixAvail); } else { if (req->hdr->type == D6_REQUEST) @@ -633,6 +633,9 @@ static void init(void) struct sockaddr_in6 addr; int sock; + if (!triton_module_loaded("ipv6_nd")) + log_warn("dhcpv6: ipv6_nd module is not loaded, you probably get misconfigured network environment\n"); + load_config(); sock = socket(AF_INET6, SOCK_DGRAM, 0); diff --git a/accel-pppd/ipv6/dhcpv6.h b/accel-pppd/ipv6/dhcpv6.h index c584eda1..c03b8d9a 100644 --- a/accel-pppd/ipv6/dhcpv6.h +++ b/accel-pppd/ipv6/dhcpv6.h @@ -55,6 +55,7 @@ #define D6_STATUS_NoBinding 3 #define D6_STATUS_NotOnLink 4 #define D6_STATUS_UseMulticast 5 +#define D6_STATUS_NoPrefixAvail 6 #define DUID_LLT 1 #define DUID_EN 2 diff --git a/accel-pppd/ipv6/dhcpv6_packet.c b/accel-pppd/ipv6/dhcpv6_packet.c index e0e348d4..4c36161b 100644 --- a/accel-pppd/ipv6/dhcpv6_packet.c +++ b/accel-pppd/ipv6/dhcpv6_packet.c @@ -416,9 +416,10 @@ static void print_status(struct dhcpv6_option *opt, void (*print)(const char *fm "NoBindings", "NotOnLink", "UseMulticast" + "NoPrefixAvail" }; - if (ntohs(o->code) < 0 || ntohs(o->code) > 5) + if (ntohs(o->code) < 0 || ntohs(o->code) > sizeof(status_name)) print(" %u", ntohs(o->code)); else print(" %s", status_name[ntohs(o->code)]); -- cgit v1.2.3