ip monitor: Allow to filter events by dev
Added 'dev' option to allow filtering events by device.
Signed-off-by: Vadim Kochan <vadim4j@gmail.com>
diff --git a/ip/ipaddress.c b/ip/ipaddress.c
index db39437..c95aa6d 100644
--- a/ip/ipaddress.c
+++ b/ip/ipaddress.c
@@ -1197,7 +1197,7 @@
char *filter_dev = NULL;
int no_link = 0;
- ipaddr_reset_filter(oneline);
+ ipaddr_reset_filter(oneline, 0);
filter.showqueue = 1;
if (filter.family == AF_UNSPEC)
@@ -1442,10 +1442,11 @@
return ipaddr_list_flush_or_save(argc, argv, IPADD_LIST);
}
-void ipaddr_reset_filter(int oneline)
+void ipaddr_reset_filter(int oneline, int ifindex)
{
memset(&filter, 0, sizeof(filter));
filter.oneline = oneline;
+ filter.ifindex = ifindex;
}
static int default_scope(inet_prefix *lcl)