{
FILE *fp = (FILE*)arg;
+ if (timestamp)
+ print_timestamp(fp);
+
if (n->nlmsg_type == RTM_NEWROUTE || n->nlmsg_type == RTM_DELROUTE) {
print_route(who, n, arg);
return 0;
int do_ipmonitor(int argc, char **argv)
{
- struct rtnl_handle rth;
char *file = NULL;
unsigned groups = ~RTMGRP_TC;
int llink=0;
int lroute=0;
int lprefix=0;
+ rtnl_close(&rth);
ipaddr_reset_filter(1);
iproute_reset_filter();
ipneigh_reset_filter();
perror("Cannot fopen");
exit(-1);
}
- return rtnl_from_file(fp, accept_msg, (void*)stdout);
+ return rtnl_from_file(fp, accept_msg, stdout);
}
if (rtnl_open(&rth, groups) < 0)
exit(1);
-
ll_init_map(&rth);
- if (rtnl_listen(&rth, accept_msg, (void*)stdout) < 0)
+ if (rtnl_listen(&rth, accept_msg, stdout) < 0)
exit(2);
- exit(0);
+ return 0;
}