Skip to content

Commit 18c73a1

Browse files
Allow IPv4 link-local nexthops (sonic-net#1903)
*Orchagent (NeighOrch) currently ignores IPv4 link-local neighbours. Any route pointing to such a nexthop is not added to the ASIC DB. Such routes are expected and should be supported. Signed-off-by: Utpal Kant Pintoo [email protected]
1 parent 7d2942f commit 18c73a1

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

orchagent/neighorch.cpp

+12-13
Original file line numberDiff line numberDiff line change
@@ -685,19 +685,6 @@ void NeighOrch::doTask(Consumer &consumer)
685685

686686
IpAddress ip_address(key.substr(found+1));
687687

688-
/* Verify Ipv4 LinkLocal and skip neighbor entry added for RFC5549 */
689-
if ((ip_address.getAddrScope() == IpAddress::LINK_SCOPE) && (ip_address.isV4()))
690-
{
691-
/* Check if this prefix is not a configured ip, if so allow */
692-
IpPrefix ipll_prefix(ip_address.getV4Addr(), 16);
693-
if (!m_intfsOrch->isPrefixSubnet (ipll_prefix, alias))
694-
{
695-
SWSS_LOG_NOTICE("Skip IPv4LL neighbor %s, Intf:%s op: %s ", ip_address.to_string().c_str(), alias.c_str(), op.c_str());
696-
it = consumer.m_toSync.erase(it);
697-
continue;
698-
}
699-
}
700-
701688
NeighborEntry neighbor_entry = { ip_address, alias };
702689

703690
if (op == SET_COMMAND)
@@ -807,6 +794,18 @@ bool NeighOrch::addNeighbor(const NeighborEntry &neighborEntry, const MacAddress
807794
memcpy(neighbor_attr.value.mac, macAddress.getMac(), 6);
808795
neighbor_attrs.push_back(neighbor_attr);
809796

797+
if ((ip_address.getAddrScope() == IpAddress::LINK_SCOPE) && (ip_address.isV4()))
798+
{
799+
/* Check if this prefix is a configured ip, if not allow */
800+
IpPrefix ipll_prefix(ip_address.getV4Addr(), 16);
801+
if (!m_intfsOrch->isPrefixSubnet (ipll_prefix, alias))
802+
{
803+
neighbor_attr.id = SAI_NEIGHBOR_ENTRY_ATTR_NO_HOST_ROUTE;
804+
neighbor_attr.value.booldata = 1;
805+
neighbor_attrs.push_back(neighbor_attr);
806+
}
807+
}
808+
810809
MuxOrch* mux_orch = gDirectory.get<MuxOrch*>();
811810
bool hw_config = isHwConfigured(neighborEntry);
812811

0 commit comments

Comments
 (0)