aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSUZUKI, Shinsuke <suz@kame.net>2007-05-03 07:11:53 +0000
committerSUZUKI, Shinsuke <suz@kame.net>2007-05-03 07:11:53 +0000
commit0f1da3209a4cd8f23d5c7b40f2572ab8647e7c75 (patch)
treeeeb678819725208c3f7586cb852e404faa614a46
parent40d44d36ce5cbfe9b2420ba08ad1983998e8bf6a (diff)
changes the destination port of a relayed DHCP packet from 546 to 547, when it is supposed to be bound for a relay, instead of a client.
(the situation occurs when DHCPv6-relays are cascased in a row)
-rw-r--r--CHANGES4
-rw-r--r--dhcp6relay.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/CHANGES b/CHANGES
index c84a695..06fe055 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,8 @@
2007-05-03 SUZUKI, Shinsuke <suz@kame.net>
+ * dhcp6relay.c: changes the destination port of a relayed DHCP packet
+ from 546 to 547, when it is supposed to be bound for a relay,
+ instead of a client. (the situation occurs when DHCPv6-relays are
+ cascased in a row)
* dhcp6s.c: fixed a Solicitation message validation error (introduced
on Mar 21 2007)
diff --git a/dhcp6relay.c b/dhcp6relay.c
index b282115..e9b6dfd 100644
--- a/dhcp6relay.c
+++ b/dhcp6relay.c
@@ -1007,6 +1007,12 @@ relay_to_client(dh6relay, len, from)
dh6 = (struct dhcp6 *) optinfo.relaymsg_msg;
if (dh6->dh6_msgtype != DH6_RELAY_REPLY) {
relayed++;
+ } else {
+ /*
+ * change dst port to server/relay port, since it's a
+ * reply to relay, not to a client
+ */
+ peer.sin6_port = htons(547); /* DH6PORT_UPSTREAM */
}
memcpy(&peer.sin6_addr, &dh6relay->dh6relay_peeraddr,
sizeof (peer.sin6_addr));