[PATCHv2 00/21] Tagged VLAN support

Michael Braun michael-dev
Thu Jun 6 03:02:46 PDT 2013


this patch series adds support for tagged VLANs.

In contrast to the first approach, it now changes the VLAN datatype from int
to VLAN_t and uses helper functions to handle modifications. This permits
reference counting and freeing when a VLAN configuration is no longer used.

Further, this patch series takes care of releasing no-longer-in-use interfaces
as well as wpa/wep keys and groups. Due to the greater number of VLAN
configurations possible with tagged VLANs, this is more likely to be important
with tagged VLANs in use.

Additionally, this patch series modifies the dynamic VLAN code to better handle
multiple BSS with different or shared tagged uplink interfaces. Therefore, a
generic global (inter-iface) interface and interface-in-bridge reference
counting datastructure is created and in turn use to handle the references
to an untagged bridge by untagged and tagged VLAN interfaces from different
BSS and ifaces. The reason for adding this to this patch series is that with
tagged VLANs, even within an BSS there might be multiple struct hostapd_VLAN
contributing to the same bridge.
It also now gets tracked whether an STA contributed to a VLAN reference counter
and decreases the reference counter when no longer using the VLAN, so the
AP_VLAN interface actually gets removed when idle.

I've verified that this patch series creates and removes interfaces as promised
on my system. Though, it looks like I hit a kernel bug when frequently removing
and creating AP_VLAN interfaces (even without tagging), which currently makes
me disable interface removal in production. But this issue should really be
solved in-kernel. The deferred interface removal has the advantage of limiting
the churn in creating and removing interfaces, so it might be useful even after
that kernel issue is resolved.

I also tried to address the code formatting hints from the last patch series.

While debugging, I found that hostapd lacks some messages in SYSLOG that are
there in STDOUT due to using wpa_printf instead of hostapd_logger. Though,
those messages are especially usefull when the device reboots regulary and
cannot keep the logs locally. I therefore modified vlan_init.c to use
hostapd_logger (which automatically adds BSS information).
As some code is shared between wpa_supplicant and hostapd, maybe makeing
hostapd wpa_printf printing to syslog would help debugging other parts of
hostapd too?

 M. Braun

Michael Braun (21):
  bridge: give bridge name in per-bss configuration
  bridge: use safe default
  bridge: track inter-BSS usage
  Avoid access to non-existing interfaces
  Remove WPA per-VLAN groups when all stations left on rekeying
  802.1X: Make VLAN-keys a list instead of an array.
  802.1X: release unused VLAN-WEP-Keys
  VLAN: remove vlan_tail
  add CONFIG_VLAN_TAGGED configuration option
  VLAN: Use new data type for VLAN description.
  VLAN: add tagged vlan to vlan data structure
  parse untagged/tagged VLANs from config files
  radius: parse tagged vlan information
  VLAN: use untagged/tagged for interface configuration
  Fix kernel NEWLINK processing
  Fix STA dynamic vlan tracking
  VLAN: reduce newlink/dellink message printing
  driver nl80211: print interface name
  VLAN: ensure destroying interfaces goes reverse as creating
  VLAN: do not remove VLAN interfaces due to kernel bug
  VLAN: use hostapd_logger

 hostapd/Makefile                 |   3 +
 hostapd/config_file.c            | 350 +++++++++++++-----
 hostapd/defconfig                |   3 +
 hostapd/hostapd.conf             |  27 +-
 hostapd/main.c                   |   3 +
 src/ap/ap_config.c               |  42 ++-
 src/ap/ap_config.h               |  44 ++-
 src/ap/ap_drv_ops.h              |   2 +-
 src/ap/hostapd.c                 |  15 +-
 src/ap/hostapd.h                 |  13 +
 src/ap/ieee802_11.c              |  23 +-
 src/ap/ieee802_11_auth.c         |  20 +-
 src/ap/ieee802_11_auth.h         |   2 +-
 src/ap/ieee802_1x.c              | 176 ++++++---
 src/ap/pmksa_cache_auth.c        |   9 +-
 src/ap/pmksa_cache_auth.h        |   2 +-
 src/ap/sta_info.c                |  81 +++--
 src/ap/sta_info.h                |  10 +-
 src/ap/vlan_init.c               | 768 ++++++++++++++++++++++++++++++---------
 src/ap/vlan_init.h               |   8 +-
 src/ap/wpa_auth.c                |  62 +++-
 src/ap/wpa_auth.h                |   5 +-
 src/ap/wpa_auth_ft.c             |   4 +-
 src/ap/wpa_auth_glue.c           |   4 +-
 src/ap/wpa_auth_i.h              |   4 +-
 src/ap/wpa_auth_ie.c             |   4 +-
 src/common/vlan.h                | 230 ++++++++++++
 src/drivers/driver.h             |   3 +-
 src/drivers/driver_nl80211.c     |  16 +-
 src/drivers/driver_test.c        |   6 +-
 src/radius/radius.c              |  71 +++-
 src/radius/radius.h              |   3 +-
 src/utils/wpa_debug.h            |   1 +
 wpa_supplicant/ibss_rsn.c        |   2 +-
 wpa_supplicant/tests/link_test.c |   5 +-
 35 files changed, 1586 insertions(+), 435 deletions(-)
 create mode 100644 src/common/vlan.h


More information about the Hostap mailing list