route: add support for exact-prefix-match via netlink.

This commit is contained in:
Alexander V. Chernikov 2023-04-02 13:50:05 +00:00
parent c35a43b261
commit 68f9e13563

View File

@ -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);