diff --git a/orchagent/vrforch.cpp b/orchagent/vrforch.cpp index 19ca5c0fd8..ad25514e62 100644 --- a/orchagent/vrforch.cpp +++ b/orchagent/vrforch.cpp @@ -9,6 +9,7 @@ #include "macaddress.h" #include "orch.h" #include "request_parser.h" +#include "routeorch.h" #include "vrforch.h" #include "vxlanorch.h" #include "directory.h" @@ -20,6 +21,7 @@ extern sai_virtual_router_api_t* sai_virtual_router_api; extern sai_object_id_t gSwitchId; extern Directory gDirectory; extern PortsOrch* gPortsOrch; +extern RouteOrch *gRouteOrch; bool VRFOrch::addOperation(const Request& request) { @@ -115,6 +117,18 @@ bool VRFOrch::addOperation(const Request& request) } m_stateVrfObjectTable.hset(vrf_name, "state", "ok"); SWSS_LOG_NOTICE("VRF '%s' was added", vrf_name.c_str()); + + IpPrefix linklocal_prefix = gRouteOrch->getLinkLocalEui64Addr(); + + gRouteOrch->addLinkLocalRouteToMe(router_id, linklocal_prefix); + SWSS_LOG_NOTICE("Created link local ipv6 route %s to cpu for VRF %s", linklocal_prefix.to_string().c_str(), vrf_name.c_str()); + + /* Add fe80::/10 subnet route to forward all link-local packets + * destined to us, to CPU */ + IpPrefix default_link_local_prefix("fe80::/10"); + + gRouteOrch->addLinkLocalRouteToMe(router_id, default_link_local_prefix); + SWSS_LOG_NOTICE("Created link local ipv6 route %s to cpu for VRF %s", default_link_local_prefix.to_string().c_str(), vrf_name.c_str()); } else {