diff --git a/nhrp/sysdep_netlink.c b/nhrp/sysdep_netlink.c index 44063ad..74907bb 100644 --- a/nhrp/sysdep_netlink.c +++ b/nhrp/sysdep_netlink.c @@ -738,13 +738,15 @@ static void netlink_route_new(struct nlmsghdr *msg) return; if (iface->flags & NHRP_INTERFACE_FLAG_SHORTCUT_DEST) { - /* Local shortcut target routes */ - if (rtm->rtm_table != iface->route_table) + /* Off-NBMA bound routes, include kernel subnet + * routes, and anything routing table. */ + if (rtm->rtm_table != iface->route_table && + rtm->rtm_protocol != RTPROT_KERNEL) return; type = NHRP_PEER_TYPE_LOCAL_ADDR; } else if (iface->flags & NHRP_INTERFACE_FLAG_CONFIGURED) { - /* Routes which might get additional outbound - * shortcuts */ + /* In-NBMA bound routes, include only specifed table + * and only non-kernel created routes */ if (rtm->rtm_table != iface->route_table || rtm->rtm_protocol == RTPROT_KERNEL) return; @@ -792,13 +794,15 @@ static void netlink_route_del(struct nlmsghdr *msg) return; if (iface->flags & NHRP_INTERFACE_FLAG_SHORTCUT_DEST) { - /* Local shortcut target routes */ - if (rtm->rtm_table != RT_TABLE_MAIN) + /* Off-NBMA bound routes, include kernel subnet + * routes, and anything routing table. */ + if (rtm->rtm_table != iface->route_table && + rtm->rtm_protocol != RTPROT_KERNEL) return; type = NHRP_PEER_TYPE_LOCAL_ADDR; } else if (iface->flags & NHRP_INTERFACE_FLAG_CONFIGURED) { - /* Routes which might get additional outbound - * shortcuts */ + /* In-NBMA bound routes, include only specifed table + * and only non-kernel created routes */ if (rtm->rtm_table != iface->route_table || rtm->rtm_protocol == RTPROT_KERNEL) return;