diff --git a/CMakeLists.txt b/CMakeLists.txt index 1493569..ff570c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -91,7 +91,13 @@ set(COMMON_SOURCES add_library(vwifi_common STATIC ${COMMON_SOURCES}) # Link common library dependencies once -target_link_libraries(vwifi_common PUBLIC Threads::Threads PkgConfig::LIBNL3) +option(BUILD_STATIC "Build static binaries" OFF) +if(BUILD_STATIC) + set(CMAKE_EXE_LINKER_FLAGS "-static") + target_link_libraries(vwifi_common PUBLIC Threads::Threads /usr/lib/x86_64-linux-gnu/libnl-genl-3.a /usr/lib/x86_64-linux-gnu/libnl-3.a) +else() + target_link_libraries(vwifi_common PUBLIC Threads::Threads PkgConfig::LIBNL3) +endif() # --- Executables --- diff --git a/src/cmonwirelessdevice.cc b/src/cmonwirelessdevice.cc index 0fdf666..1d41684 100644 --- a/src/cmonwirelessdevice.cc +++ b/src/cmonwirelessdevice.cc @@ -323,7 +323,7 @@ void MonitorWirelessDevice::new_net_interface(struct nlmsghdr *h) if(inetdevice.checkif_wireless_device()){ - get_winterface_infos(ifi->ifi_index); // we can call a callback here, instead calling it in recv_winterface_infos, to reduce cpu + _newinet_cb(inetdevice); // Fix: call directly, skip nl80211 roundtrip (races with winet_update_loop) } }