aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sbin/route/route_netlink.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/route/route_netlink.c b/sbin/route/route_netlink.c
index 66b1920a58db..ce7da288496f 100644
--- a/sbin/route/route_netlink.c
+++ b/sbin/route/route_netlink.c
@@ -203,6 +203,10 @@ rtmsg_nl_int(struct nl_helper *h, int cmd, int rtm_flags, int fib,
rtm->rtm_type = rtm_type;
rtm->rtm_dst_len = plen;
+ /* Request exact prefix match if mask is set */
+ if ((cmd == RTSOCK_RTM_GET) && (mask != NULL))
+ rtm->rtm_flags = RTM_F_PREFIX;
+
snl_add_msg_attr_ip(&nw, RTA_DST, dst);
snl_add_msg_attr_u32(&nw, RTA_TABLE, fib);