summaryrefslogtreecommitdiff
path: root/zebra/rt_netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'zebra/rt_netlink.c')
-rw-r--r--zebra/rt_netlink.c34
1 files changed, 11 insertions, 23 deletions
diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
index f69df1da89..3868412b20 100644
--- a/zebra/rt_netlink.c
+++ b/zebra/rt_netlink.c
@@ -1140,8 +1140,7 @@ static void _netlink_route_build_singlepath(const char *routedesc, int bytelen,
if (nexthop->type != NEXTHOP_TYPE_BLACKHOLE)
addattr32(nlmsg, req_size, RTA_OIF, nexthop->ifindex);
- if (nexthop->type == NEXTHOP_TYPE_IFINDEX
- || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX) {
+ if (nexthop->type == NEXTHOP_TYPE_IFINDEX) {
if (cmd == RTM_NEWROUTE) {
if (nexthop->rmap_src.ipv4.s_addr)
addattr_l(nlmsg, req_size, RTA_PREFSRC,
@@ -1157,23 +1156,6 @@ static void _netlink_route_build_singlepath(const char *routedesc, int bytelen,
"nexthop via if %u(%u)",
routedesc, nexthop->ifindex, nexthop->vrf_id);
}
-
- if (nexthop->type == NEXTHOP_TYPE_IPV6_IFINDEX) {
- if (cmd == RTM_NEWROUTE) {
- if (!IN6_IS_ADDR_UNSPECIFIED(&nexthop->rmap_src.ipv6))
- addattr_l(nlmsg, req_size, RTA_PREFSRC,
- &nexthop->rmap_src.ipv6, bytelen);
- else if (!IN6_IS_ADDR_UNSPECIFIED(&nexthop->src.ipv6))
- addattr_l(nlmsg, req_size, RTA_PREFSRC,
- &nexthop->src.ipv6, bytelen);
- }
-
- if (IS_ZEBRA_DEBUG_KERNEL)
- zlog_debug(
- "netlink_route_multipath() (%s): "
- "nexthop via if %u(%u)",
- routedesc, nexthop->ifindex, nexthop->vrf_id);
- }
}
/* This function takes a nexthop as argument and
@@ -1345,8 +1327,7 @@ static void _netlink_route_build_multipath(const char *routedesc, int bytelen,
rtnh->rtnh_ifindex = nexthop->ifindex;
/* ifindex */
- if (nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX
- || nexthop->type == NEXTHOP_TYPE_IFINDEX) {
+ if (nexthop->type == NEXTHOP_TYPE_IFINDEX) {
if (nexthop->rmap_src.ipv4.s_addr)
*src = &nexthop->rmap_src;
else if (nexthop->src.ipv4.s_addr)
@@ -2720,12 +2701,12 @@ static int netlink_neigh_update2(struct interface *ifp, struct ipaddr *ip,
addattr_l(&req.n, sizeof(req), NDA_LLADDR, mac, 6);
if (IS_ZEBRA_DEBUG_KERNEL)
- zlog_debug("Tx %s family %s IF %s(%u) Neigh %s MAC %s flags 0x%x",
+ zlog_debug("Tx %s family %s IF %s(%u) Neigh %s MAC %s flags 0x%x state 0x%x",
nl_msg_type_to_str(cmd),
nl_family_to_str(req.ndm.ndm_family), ifp->name,
ifp->ifindex, ipaddr2str(ip, buf, sizeof(buf)),
mac ? prefix_mac2str(mac, buf2, sizeof(buf2))
- : "null", flags);
+ : "null", flags, state);
return netlink_talk(netlink_talk_filter, &req.n, &zns->netlink_cmd, zns,
0);
@@ -2756,6 +2737,13 @@ int kernel_del_neigh(struct interface *ifp, struct ipaddr *ip)
return netlink_neigh_update2(ifp, ip, NULL, 0, 0, RTM_DELNEIGH);
}
+int kernel_upd_neigh(struct interface *ifp, struct ipaddr *ip,
+ struct ethaddr *mac, uint8_t flags, uint16_t state)
+{
+ return netlink_neigh_update2(ifp, ip, mac, flags,
+ state, RTM_NEWNEIGH);
+}
+
/*
* MPLS label forwarding table change via netlink interface, using dataplane
* context information.