git://git.onelab.eu
/
iproute2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
sync to iproute2-2.6.16-060323
[iproute2.git]
/
ip
/
ipmonitor.c
diff --git
a/ip/ipmonitor.c
b/ip/ipmonitor.c
index
cdaeb6f
..
50b6327
100644
(file)
--- a/
ip/ipmonitor.c
+++ b/
ip/ipmonitor.c
@@
-38,6
+38,9
@@
int accept_msg(const struct sockaddr_nl *who,
{
FILE *fp = (FILE*)arg;
{
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;
if (n->nlmsg_type == RTM_NEWROUTE || n->nlmsg_type == RTM_DELROUTE) {
print_route(who, n, arg);
return 0;
@@
-85,7
+88,6
@@
int accept_msg(const struct sockaddr_nl *who,
int do_ipmonitor(int argc, char **argv)
{
int do_ipmonitor(int argc, char **argv)
{
- struct rtnl_handle rth;
char *file = NULL;
unsigned groups = ~RTMGRP_TC;
int llink=0;
char *file = NULL;
unsigned groups = ~RTMGRP_TC;
int llink=0;
@@
-93,6
+95,7
@@
int do_ipmonitor(int argc, char **argv)
int lroute=0;
int lprefix=0;
int lroute=0;
int lprefix=0;
+ rtnl_close(&rth);
ipaddr_reset_filter(1);
iproute_reset_filter();
ipneigh_reset_filter();
ipaddr_reset_filter(1);
iproute_reset_filter();
ipneigh_reset_filter();
@@
-150,16
+153,15
@@
int do_ipmonitor(int argc, char **argv)
perror("Cannot fopen");
exit(-1);
}
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);
}
if (rtnl_open(&rth, groups) < 0)
exit(1);
-
ll_init_map(&rth);
ll_init_map(&rth);
- if (rtnl_listen(&rth, accept_msg,
(void*)
stdout) < 0)
+ if (rtnl_listen(&rth, accept_msg, stdout) < 0)
exit(2);
exit(2);
-
exit(0)
;
+
return 0
;
}
}