diff options
author | Jaap Keuter <jaap.keuter@xs4all.nl> | 2019-08-07 19:31:41 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2019-08-11 20:20:34 +0000 |
commit | 486efaedb1d81a482ac76cc6f1b14ca6159cf524 (patch) | |
tree | 4d9ffc213b1459b77f980b25bdbbcfdc5f0d9343 /caputils | |
parent | 7bd3edccf12f9eb51c5c36ab1770387a9bdcf3d2 (diff) |
make interface update libnl1 compatible
With libnl1 its not possible to get from the message the same notice of
the interface being added or removed as with libnl3. This code has to be
reserved for libnl3 only. Make compilation of this code conditionsal.
Bug: 15981
Change-Id: I2588fd2ba6508a8544bdd4eac46436b4f78ee524
Reviewed-on: https://code.wireshark.org/review/34242
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'caputils')
-rw-r--r-- | caputils/iface_monitor.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/caputils/iface_monitor.c b/caputils/iface_monitor.c index fb04044d2f..6d79829143 100644 --- a/caputils/iface_monitor.c +++ b/caputils/iface_monitor.c @@ -82,7 +82,6 @@ iface_mon_handler2(struct nl_object *obj, void *arg) return; } - int msg_type = nl_object_get_msgtype(obj); link_obj = (struct rtnl_link *) obj; flags = rtnl_link_get_flags (link_obj); ifname = rtnl_link_get_name(link_obj); @@ -100,6 +99,11 @@ iface_mon_handler2(struct nl_object *obj, void *arg) */ up = (flags & IFF_UP) ? 1 : 0; +#ifdef HAVE_LIBNL1 + cb(ifname, 0, up); +#else + int msg_type = nl_object_get_msgtype(obj); + switch (msg_type) { case RTM_NEWLINK: cb(ifname, 1, up); @@ -111,6 +115,8 @@ iface_mon_handler2(struct nl_object *obj, void *arg) /* Ignore other events */ break; } +#endif + rtnl_link_put(filter); return; |