Commit 3a25cf88 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[3548] Reordered MAC aquisition methods.

parent f9394bda
......@@ -141,7 +141,19 @@ Pkt::getMAC(uint32_t hw_addr_src) {
}
}
// Method 2: Extracted from DUID-LLT or DUID-LL
// Method 2: From client link-layer address option inserted by a relay
if (hw_addr_src & HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION) {
mac = getMACFromIPv6RelayOpt();
if (mac) {
return (mac);
} else if (hw_addr_src == 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());
}
}
// Method 3: Extracted from DUID-LLT or DUID-LL
if(hw_addr_src & HWADDR_SOURCE_DUID) {
mac = getMACFromDUID();
if (mac) {
......@@ -153,8 +165,8 @@ Pkt::getMAC(uint32_t hw_addr_src) {
}
}
// Method 3: Extracted from source IPv6 link-local address
if (hw_addr_src & HWAddr::HWADDR_SOURCE_IPV6_LINK_LOCAL) {
// Method 4: Extracted from source IPv6 link-local address
if (hw_addr_src & HWaddr::HWADDR_SOURCE_IPV6_LINK_LOCAL) {
mac = getMACFromSrcLinkLocalAddr();
if (mac) {
return (mac);
......@@ -165,18 +177,6 @@ Pkt::getMAC(uint32_t hw_addr_src) {
}
}
// Method 4: From client link-layer address option inserted by a relay
if (hw_addr_src & HWAddr::HWADDR_SOURCE_CLIENT_ADDR_RELAY_OPTION) {
mac = getMACFromIPv6RelayOpt();
if (mac) {
return (mac);
} 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());
}
}
// Method 5: From remote-id option inserted by a relay
// Method 6: From subscriber-id option inserted by a relay
......
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