Commit b316000a authored by Juliusz Chroboczek's avatar Juliusz Chroboczek

Move checking for main table to parse_kernel_route_rta.

parent 3a64c4b4
...@@ -745,7 +745,7 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen, ...@@ -745,7 +745,7 @@ kernel_route(int operation, const unsigned char *dest, unsigned short plen,
static int static int
parse_kernel_route_rta(struct rtmsg *rtm, int len, struct kernel_route *route) parse_kernel_route_rta(struct rtmsg *rtm, int len, struct kernel_route *route)
{ {
int table = RT_TABLE_MAIN; int table = rtm->rtm_table;
struct rtattr *rta= RTM_RTA(rtm);; struct rtattr *rta= RTM_RTA(rtm);;
len -= NLMSG_ALIGN(sizeof(*rtm)); len -= NLMSG_ALIGN(sizeof(*rtm));
...@@ -782,6 +782,7 @@ parse_kernel_route_rta(struct rtmsg *rtm, int len, struct kernel_route *route) ...@@ -782,6 +782,7 @@ parse_kernel_route_rta(struct rtmsg *rtm, int len, struct kernel_route *route)
if(table != RT_TABLE_MAIN) if(table != RT_TABLE_MAIN)
return -1; return -1;
return 0; return 0;
} }
...@@ -853,9 +854,6 @@ filter_kernel_routes(struct nlmsghdr *nh, void *data) ...@@ -853,9 +854,6 @@ filter_kernel_routes(struct nlmsghdr *nh, void *data)
if(rtm->rtm_dst_len > maxplen || rtm->rtm_src_len != 0) if(rtm->rtm_dst_len > maxplen || rtm->rtm_src_len != 0)
return 0; return 0;
if(rtm->rtm_table != RT_TABLE_MAIN)
return 0;
if(data) if(data)
current_route = &routes[*found]; current_route = &routes[*found];
else else
......
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