Commit f6d9630e authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[3548] Compilation fix.

parent 27441216
......@@ -1884,9 +1884,10 @@ should include options from the isc option space:
</simpara>
</listitem>
<listitem>
<simpara><command>raw</command> In principle, a DHCPv6 server could use raw
<simpara><command>raw</command> - In principle, a DHCPv6 server could use raw
sockets to receive incoming traffic and extract MAC/hardware address
information. This is currently not implemented and this value has no effect.
information. This is currently not implemented for DHCPv6 and this value has
no effect.
</simpara>
</listitem>
<listitem>
......
......@@ -142,11 +142,11 @@ Pkt::getMAC(uint32_t hw_addr_src) {
}
// Method 2: From client link-layer address option inserted by a relay
if (hw_addr_src & HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION) {
if (hw_addr_src & HWAddr::HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION) {
mac = getMACFromIPv6RelayOpt();
if (mac) {
return (mac);
} else if (hw_addr_src == HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION) {
} else if (hw_addr_src == HWAddr::HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION) {
// If we're interested only in RFC6939 link layer address as source
// of that info, there's no point in trying other options.
return (HWAddrPtr());
......@@ -154,11 +154,11 @@ Pkt::getMAC(uint32_t hw_addr_src) {
}
// Method 3: Extracted from DUID-LLT or DUID-LL
if(hw_addr_src & HWADDR_SOURCE_DUID) {
if(hw_addr_src & HWAddr::HWADDR_SOURCE_DUID) {
mac = getMACFromDUID();
if (mac) {
return (mac);
} else if (hw_addr_src == HWADDR_SOURCE_DUID) {
} else if (hw_addr_src == HWAddr::HWADDR_SOURCE_DUID) {
// If the only source allowed is DUID then we can skip the other
// methods.
return (HWAddrPtr());
......@@ -166,7 +166,7 @@ Pkt::getMAC(uint32_t hw_addr_src) {
}
// Method 4: Extracted from source IPv6 link-local address
if (hw_addr_src & HWaddr::HWADDR_SOURCE_IPV6_LINK_LOCAL) {
if (hw_addr_src & HWAddr::HWADDR_SOURCE_IPV6_LINK_LOCAL) {
mac = getMACFromSrcLinkLocalAddr();
if (mac) {
return (mac);
......
......@@ -1161,18 +1161,18 @@ TEST_F(Pkt6Test, getMACFromDUID) {
duid_en, duid_en + sizeof(duid_en))));
// Packet does not have any client-id, this call should fail
EXPECT_FALSE(pkt.getMAC(Pkt::HWADDR_SOURCE_DUID));
EXPECT_FALSE(pkt.getMAC(HWAddr::HWADDR_SOURCE_DUID));
// Let's test DUID-LLT. This should work.
pkt.addOption(clientid1);
HWAddrPtr mac = pkt.getMAC(Pkt::HWADDR_SOURCE_DUID);
HWAddrPtr mac = pkt.getMAC(HWAddr::HWADDR_SOURCE_DUID);
ASSERT_TRUE(mac);
EXPECT_EQ("hwtype=7 0a:0b:0c:0d:0e:0f:10", mac->toText(true));
// Let's test DUID-LL. This should work.
ASSERT_TRUE(pkt.delOption(D6O_CLIENTID));
pkt.addOption(clientid2);
mac = pkt.getMAC(Pkt::HWADDR_SOURCE_DUID);
mac = pkt.getMAC(HWAddr::HWADDR_SOURCE_DUID);
ASSERT_TRUE(mac);
EXPECT_EQ("hwtype=11 0a:0b:0c:0d:0e", mac->toText(true));
......@@ -1180,7 +1180,7 @@ TEST_F(Pkt6Test, getMACFromDUID) {
// contain any MAC address information.
ASSERT_TRUE(pkt.delOption(D6O_CLIENTID));
pkt.addOption(clientid3);
EXPECT_FALSE(pkt.getMAC(Pkt::HWADDR_SOURCE_DUID));
EXPECT_FALSE(pkt.getMAC(HWAddr::HWADDR_SOURCE_DUID));
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment