Hi,
Am 07.07.2012 10:52, schrieb Michael Braun:
> This permits hostapd to set the name of the created interface.> ---> src/ap/vlan_util.c | 137
the reason for moving vlan_add/vlan_rem into this new file is that the
netlink/link.h and net/if.h headers conflict.
http://lists.infradead.org/pipermail/libnl/2012-April/000552.html
Regards,
M. Braun

On Sat, Jul 07, 2012 at 10:52:12AM +0200, Michael Braun wrote:
> This permits hostapd to set the name of the created interface.
One question about the copyright and license statements in the new files
that needs to be addressed before I can apply these:
> diff --git a/src/ap/vlan_util.c b/src/ap/vlan_util.c> new file mode 100644> index 0000000..ca18963> --- /dev/null> +++ b/src/ap/vlan_util.c> @@ -0,0 +1,137 @@> +/*> + * hostapd / VLAN initialization> + * Copyright 2003, Instant802 Networks, Inc.> + * Copyright 2005-2006, Devicescape Software, Inc.> + * Copyright (c) 2009, Jouni Malinen <j@w1.fi>> + *> + * This program is free software; you can redistribute it and/or modify> + * it under the terms of the GNU General Public License version 2 as> + * published by the Free Software Foundation.> + *> + * Alternatively, this software may be distributed under the terms of BSD> + * license.> + *> + * See README and COPYING for more details.> + */
This copyright notice and license statement do not look correct. Isn't
this (and same for vlan_util.h) new code? If so, there is not much point
in copying the copyright statements from vlan_init.c. In addition, any
new files needs to use the BSD license language (i.e., drop the GPLv2
alternative):
* This software may be distributed under the terms of the BSD license.
* See README for more details.

On Thu, Aug 09, 2012 at 11:54:56AM +0200, Michael Braun wrote:
> These patches make hostapd use the netlink api to create and remove vlan> interfaces instead of the old kernel api.> This removes the dependency from the system global linux vlan interface name> type. It thus avoids conflicts with other applications, that can result in> a non-usable network configuration, as the new vlan interfaces won't be added> into the brige (due to the expected name being different from the actual name).
Thanks, applied with changes described below.
This seems to depend on libnl 3.1 or newer which is somewhat of an
unfortunate dependency to add since it breaks hostapd builds on most
existing platforms.. I added this as an optional build parameter instead
of replacement of the ioctl-based calls.
If the global parameter is fine (and why wouldn't it be?), it looks like
the ioctl-based interface can still be used with this in
full_dynamic_vlan_init():
- vlan_set_name_type(VLAN_NAME_TYPE_PLUS_VID_NO_PAD);
+ vlan_set_name_type(hapd->conf->ssid.vlan_naming ==
+ DYNAMIC_VLAN_NAMING_WITH_DEVICE ?
+ VLAN_NAME_TYPE_RAW_PLUS_VID_NO_PAD :
+ VLAN_NAME_TYPE_PLUS_VID_NO_PAD);
If that is not enough, adding CONFIG_VLAN_NETLINK=y into hostapd/.config
will replace the kernel API to netlink (with the cost of having to have
a suitable libnl version available).