1. 28 7月, 2009 3 次提交
    • J
      mac80211: allow using network namespaces · a272a720
      Johannes Berg 提交于
      This finally opens up the ability to put mac80211 devices
      into different network namespaces. As long as you don't
      have sysfs, that is.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      a272a720
    • J
      cfg80211: make aware of net namespaces · 463d0183
      Johannes Berg 提交于
      In order to make cfg80211/nl80211 aware of network namespaces,
      we have to do the following things:
      
       * del_virtual_intf method takes an interface index rather
         than a netdev pointer - simply change this
      
       * nl80211 uses init_net a lot, it changes to use the sender's
         network namespace
      
       * scan requests use the interface index, hold a netdev pointer
         and reference instead
      
       * we want a wiphy and its associated virtual interfaces to be
         in one netns together, so
          - we need to be able to change ns for a given interface, so
            export dev_change_net_namespace()
          - for each virtual interface set the NETIF_F_NETNS_LOCAL
            flag, and clear that flag only when the wiphy changes ns,
            to disallow breaking this invariant
      
       * when a network namespace goes away, we need to reparent the
         wiphy to init_net
      
       * cfg80211 users that support creating virtual interfaces must
         create them in the wiphy's namespace, currently this affects
         only mac80211
      
      The end result is that you can now switch an entire wiphy into
      a different network namespace with the new command
      	iw phy#<idx> set netns <pid>
      and all virtual interfaces will follow (or the operation fails).
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      463d0183
    • J
      mac80211: cooperate more with network namespaces · 5061b0c2
      Johannes Berg 提交于
      There are still two places in mac80211 that hardcode
      the initial net namespace (init_net). One of them is
      mandated by cfg80211 and will be removed by a separate
      patch, the other one is used for finding the network
      device of a pending packet via its ifindex.
      
      Remove the latter use by keeping track of the device
      pointer itself, via the vif pointer, and avoid it
      going stale by dropping pending frames for a given
      interface when the interface is removed.
      
      To keep track of the vif pointer for the correct
      interface, change the info->control.vif pointer's
      internal use to always be the correct vif, and only
      move it to the vif the driver expects (or NULL for
      monitor interfaces and injected packets) right before
      giving the packet to the driver.
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NJohn W. Linville <linville@tuxdriver.com>
      5061b0c2
  2. 27 7月, 2009 24 次提交
  3. 26 7月, 2009 13 次提交