-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
response->setRemotePort(DHCP4_CLIENT_PORT);
} else {
- // draft-ietf-dhc-relay-port-10.txt section 5.1
+ // RFC 8357 section 5.1
uint16_t relay_port = checkRelayPort(ex);
response->setRemotePort(relay_port ? relay_port : DHCP4_SERVER_PORT);
}
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// Set hops value for the response.
resp->setHops(req->getHops());
+ // Set the remote port to 67 as we know it will be updated.
+ resp->setRemotePort(67);
+
// This function never throws.
ASSERT_NO_THROW(NakedDhcpv4Srv::adjustIfaceData(ex));
// Now the destination address should be relay's address.
EXPECT_EQ("192.0.1.1", resp->getRemoteAddr().toText());
- // The query has been relayed, so the response must be sent to the port 67.
+ // The query has been relayed, so the response should be sent to the
+ // port 67, but here there is a relay port RAI so another value is used.
EXPECT_EQ(1234, resp->getRemotePort());
// Local address should be the address assigned to interface eth1.
EXPECT_EQ("192.0.2.5", resp->getLocalAddr().toText());
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
rsp->setRemotePort(DHCP6_CLIENT_PORT);
} else {
// Relayed traffic, send back to the relay agent
- uint16_t relay_port = testRelaySourcePort(query);
+ uint16_t relay_port = checkRelaySourcePort(query);
rsp->setRemotePort(relay_port ? relay_port : DHCP6_SERVER_PORT);
}
}
}
-uint16_t Dhcpv6Srv::testRelaySourcePort(const Pkt6Ptr& query) {
+uint16_t Dhcpv6Srv::checkRelaySourcePort(const Pkt6Ptr& query) {
if (query->relay_info_.empty()) {
// No relay agent
// Did the last relay agent add a relay-source-port?
if (query->getRelayOption(D6O_RELAY_SOURCE_PORT, 0)) {
- // draft-ietf-dhc-relay-port-10.txt section 5.2
+ // RFC 8357 section 5.2
return (query->getRemotePort());
}
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
///
/// @param query DHCPv6 message to be checked.
/// @return the port to use to join the relay or 0 for the default.
- static uint16_t testRelaySourcePort(const Pkt6Ptr& query);
+ static uint16_t checkRelaySourcePort(const Pkt6Ptr& query);
private:
-// Copyright (C) 2015-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// Should we check it is a DHCPV6_DHCPV4_RESPONSE?
// Handle relay port
- uint16_t relay_port = Dhcpv6Srv::testRelaySourcePort(pkt);
+ uint16_t relay_port = Dhcpv6Srv::checkRelaySourcePort(pkt);
// The received message has been unpacked by the receive() function. This
// method could have modified the message so it's better to pack() it
-// Copyright (C) 2011-2017 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2011-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
/*
- * Copyright (C) 2004-2017 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright (C) 2004-2018 Internet Systems Consortium, Inc. ("ISC")
* Copyright (c) 1995-2003 by Internet Software Consortium
*
* This Source Code Form is subject to the terms of the Mozilla Public
static const uint16_t RAI_OPTION_ACCESS_POINT_BSSID = 16; // RFC7839
static const uint16_t RAI_OPTION_OPERATOR_ID = 17; // RFC7839
static const uint16_t RAI_OPTION_OPERATOR_REALM = 18; // RFC7839
-static const uint16_t RAI_OPTION_RELAY_PORT = 19; // I-D, to be assigned
+static const uint16_t RAI_OPTION_RELAY_PORT = 19; // RFC8357
static const uint16_t RAI_OPTION_VIRTUAL_SUBNET_SELECT = 151; //RFC6607
static const uint16_t RAI_OPTION_VIRTUAL_SUBNET_SELECT_CTRL = 152; //RFC6607
// D6O_F_SERVER_STATE = 132, /* RFC8156 */
// D6O_F_START_TIME_OF_STATE = 133, /* RFC8156 */
// D6O_F_STATE_EXPIRATION_TIME = 134, /* RFC8156 */
-// not yet assigned but next free value
- D6O_RELAY_SOURCE_PORT = 135, /* draft-ietf-dhc-relay-port-10.txt */
- // 135-142 unassigned
+ D6O_RELAY_SOURCE_PORT = 135, /* RFC8357 */
+ // 136-142 unassigned
D6O_IPV6_ADDRESS_ANDSF = 143, /* RFC6153 */
// The following are EXPERIMENTAL and may change when IANA assigns official