free(this);
}
+/**
+ * Check if the route received with RTM_NEWROUTE is usable based on its type.
+ */
+static bool route_usable(struct nlmsghdr *hdr)
+{
+ struct rtmsg *msg;
+
+ msg = NLMSG_DATA(hdr);
+ switch (msg->rtm_type)
+ {
+ case RTN_BLACKHOLE:
+ case RTN_UNREACHABLE:
+ case RTN_PROHIBIT:
+ case RTN_THROW:
+ return FALSE;
+ default:
+ return TRUE;
+ }
+}
+
/**
* Parse route received with RTM_NEWROUTE. The given rt_entry_t object will be
* reused if not NULL.
rt_entry_t *other;
uintptr_t table;
+ if (!route_usable(current))
+ {
+ continue;
+ }
route = parse_route(current, route);
table = (uintptr_t)route->table;