Browse Source

Added some rtm_flags

master
Aitor 9 months ago
parent
commit
18602a4750
  1. 17
      src/iproute.c

17
src/iproute.c

@ -117,12 +117,15 @@ rtnl_filter_t print_route(const struct sockaddr_nl *who, struct nlmsghdr *n)
int flags=0;
if (r->rtm_flags) {
if (RTNH_F_DEAD) flags=1;
if (RTNH_F_ONLINK) flags=2;
if (RTNH_F_PERVASIVE) flags=3;
if (RTNH_F_OFFLOAD) flags=4;
if (RTM_F_NOTIFY) flags=5;
if (RTNH_F_LINKDOWN) flags=6;
if (RTNH_F_DEAD) flags=1;
if (RTNH_F_ONLINK) flags=2;
if (RTNH_F_PERVASIVE) flags=3;
if (RTNH_F_OFFLOAD) flags=4;
if (RTM_F_NOTIFY) flags=5;
if (RTNH_F_LINKDOWN) flags=6;
if (RTNH_F_UNRESOLVED) flags=7;
if (RTM_F_OFFLOAD) flags=8;
if (RTM_F_TRAP) flags=9;
}
parse_rtattr(tb, RTA_MAX, RTM_RTA(r), len);
@ -132,7 +135,7 @@ rtnl_filter_t print_route(const struct sockaddr_nl *who, struct nlmsghdr *n)
* For more details, see the manpages of netlink:
* http://man7.org/linux/man-pages/man7/rtnetlink.7.html
* */
if (tb[RTA_OIF] && filter.oifmask != -1 && (tb[RTA_GATEWAY] && filter.rvia.bitlen != host_len) && flags==0)
if (tb[RTA_OIF] && filter.oifmask != -1 && (tb[RTA_GATEWAY] && filter.rvia.bitlen != host_len) && (flags == 0 || flags == 9))
strcpy(ifname, ll_index_to_name(*(int *)RTA_DATA(tb[RTA_OIF])));
return 0;

Loading…
Cancel
Save