Commit cc737787 authored by Gregoire Henry's avatar Gregoire Henry Committed by Juliusz Chroboczek

Revert "Kernel_socket: do not use the RTF_PROTO2 flag."

This flag is easiest way to filter out babel's route in the
kernel_routes function.

This reverts commit 0845af77.
parent e01f1925
...@@ -460,7 +460,7 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen, ...@@ -460,7 +460,7 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
return -1; return -1;
}; };
msg.m_rtm.rtm_index = ifindex; msg.m_rtm.rtm_index = ifindex;
msg.m_rtm.rtm_flags = RTF_UP; msg.m_rtm.rtm_flags = RTF_UP | RTF_PROTO2;
if(plen == 128) msg.m_rtm.rtm_flags |= RTF_HOST; if(plen == 128) msg.m_rtm.rtm_flags |= RTF_HOST;
if(metric == KERNEL_INFINITY) { if(metric == KERNEL_INFINITY) {
msg.m_rtm.rtm_flags |= RTF_BLACKHOLE; msg.m_rtm.rtm_flags |= RTF_BLACKHOLE;
...@@ -598,6 +598,10 @@ parse_kernel_route(const struct rt_msghdr *rtm, struct kernel_route *route) ...@@ -598,6 +598,10 @@ parse_kernel_route(const struct rt_msghdr *rtm, struct kernel_route *route)
/* Filter out multicast route on others BSD */ /* Filter out multicast route on others BSD */
excluded_flags |= RTF_MULTICAST; excluded_flags |= RTF_MULTICAST;
#endif #endif
/* Filter out our own route */
excluded_flags |= RTF_PROTO2;
if((rtm->rtm_flags & excluded_flags) != 0)
return -1;
/* Prefix */ /* Prefix */
if(!(rtm->rtm_addrs & RTA_DST)) if(!(rtm->rtm_addrs & RTA_DST))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment