From 0f1da3209a4cd8f23d5c7b40f2572ab8647e7c75 Mon Sep 17 00:00:00 2001 From: "SUZUKI, Shinsuke" Date: Thu, 3 May 2007 07:11:53 +0000 Subject: 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) --- CHANGES | 4 ++++ dhcp6relay.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGES b/CHANGES index c84a695..06fe055 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,8 @@ 2007-05-03 SUZUKI, Shinsuke + * 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)); -- cgit v1.2.3