summaryrefslogtreecommitdiff
path: root/server/dhcpv6.c
diff options
context:
space:
mode:
authorShawn Routhier <sar@isc.org>2013-11-25 21:00:41 -0800
committerShawn Routhier <sar@isc.org>2013-11-25 21:00:41 -0800
commit619304cd878299078b5dde9ad0fe30c3a7592026 (patch)
tree610293de37d4323a820b284dbbd3fece27fde1b3 /server/dhcpv6.c
parent0895c955d16a957107771e442397c6260d92cbc2 (diff)
downloadisc-dhcp-619304cd878299078b5dde9ad0fe30c3a7592026.tar.gz
[master] Support using v6 relay options in server decicions.
Diffstat (limited to 'server/dhcpv6.c')
-rw-r--r--server/dhcpv6.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/server/dhcpv6.c b/server/dhcpv6.c
index 6daba5e4..45ea753c 100644
--- a/server/dhcpv6.c
+++ b/server/dhcpv6.c
@@ -6299,41 +6299,54 @@ static void
build_dhcpv6_reply(struct data_string *reply, struct packet *packet) {
memset(reply, 0, sizeof(*reply));
- /* Classify the client */
- classify_client(packet);
+ /* I would like to classify the client once here, but
+ * as I don't want to classify all of the incoming packets
+ * I need to do it before handling specific types.
+ * We don't need to classify if we are tossing the packet
+ * or if it is a relay - the classification step will get
+ * done when we process the inner client packet.
+ */
switch (packet->dhcpv6_msg_type) {
case DHCPV6_SOLICIT:
+ classify_client(packet);
dhcpv6_solicit(reply, packet);
break;
case DHCPV6_ADVERTISE:
dhcpv6_discard(packet);
break;
case DHCPV6_REQUEST:
+ classify_client(packet);
dhcpv6_request(reply, packet);
break;
case DHCPV6_CONFIRM:
+ classify_client(packet);
dhcpv6_confirm(reply, packet);
break;
case DHCPV6_RENEW:
+ classify_client(packet);
dhcpv6_renew(reply, packet);
break;
case DHCPV6_REBIND:
+ classify_client(packet);
dhcpv6_rebind(reply, packet);
break;
case DHCPV6_REPLY:
dhcpv6_discard(packet);
break;
case DHCPV6_RELEASE:
+ classify_client(packet);
dhcpv6_release(reply, packet);
break;
case DHCPV6_DECLINE:
+ classify_client(packet);
dhcpv6_decline(reply, packet);
break;
case DHCPV6_RECONFIGURE:
dhcpv6_discard(packet);
break;
case DHCPV6_INFORMATION_REQUEST:
+ classify_client(packet);
dhcpv6_information_request(reply, packet);
break;
case DHCPV6_RELAY_FORW:
@@ -6343,6 +6356,7 @@ build_dhcpv6_reply(struct data_string *reply, struct packet *packet) {
dhcpv6_discard(packet);
break;
case DHCPV6_LEASEQUERY:
+ classify_client(packet);
dhcpv6_leasequery(reply, packet);
break;
case DHCPV6_LEASEQUERY_REPLY: