]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Take ownership of dynamically added interfaces
authorIlan Peer <ilan.peer@intel.com>
Thu, 24 Apr 2014 05:45:33 +0000 (08:45 +0300)
committerJouni Malinen <j@w1.fi>
Tue, 29 Apr 2014 15:59:12 +0000 (18:59 +0300)
Indicate to cfg80211 that interfaces created by the wpa_supplicant
or hostapd are owned by them, and that in case that the socket that
created them closes, these interfaces should be removed.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
src/drivers/driver_nl80211.c

index 9c733695f11c630d2d98b5f67399cb80660c24dc..1196bc17128609828d6abcb7f1d0bc7108f2d24a 100644 (file)
@@ -7705,6 +7705,12 @@ static int nl80211_create_iface_once(struct wpa_driver_nl80211_data *drv,
                NLA_PUT_U8(msg, NL80211_ATTR_4ADDR, wds);
        }
 
+       /*
+        * Tell cfg80211 that the interface belongs to the socket that created
+        * it, and the interface should be deleted when the socket is closed.
+        */
+       NLA_PUT_FLAG(msg, NL80211_ATTR_IFACE_SOCKET_OWNER);
+
        ret = send_and_recv_msgs(drv, msg, handler, arg);
        msg = NULL;
        if (ret) {