summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKozlov Dmitry <xeb@mail.ru>2011-08-28 23:01:32 +0400
committerKozlov Dmitry <xeb@mail.ru>2011-08-28 23:01:32 +0400
commitc700bd6c31878c17ce51f4a3f0b7e060d1db3df0 (patch)
tree1d35f882806c159fbc41c61ea02e1e7e408da684
parent27f33ddc2a653879f202cc3e3a85af73a3e5ea1f (diff)
downloadaccel-ppp-c700bd6c31878c17ce51f4a3f0b7e060d1db3df0.tar.gz
accel-ppp-c700bd6c31878c17ce51f4a3f0b7e060d1db3df0.zip
ipv6_dhcp: use NoPrefixAvail instead of NoAddrsAvail for IA_PD
-rw-r--r--accel-pppd/ipv6/dhcpv6.c5
-rw-r--r--accel-pppd/ipv6/dhcpv6.h1
-rw-r--r--accel-pppd/ipv6/dhcpv6_packet.c3
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)]);