Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VRF] Install IPv6 link local route for new VRF #1926

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions orchagent/vrforch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -20,6 +21,7 @@ extern sai_virtual_router_api_t* sai_virtual_router_api;
extern sai_object_id_t gSwitchId;
extern Directory<Orch*> gDirectory;
extern PortsOrch* gPortsOrch;
extern RouteOrch *gRouteOrch;

bool VRFOrch::addOperation(const Request& request)
{
Expand Down Expand Up @@ -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
{
Expand Down