openvswitch and hostap?

Dan Williams dcbw at redhat.com
Mon Nov 24 13:26:20 EST 2014


On Sun, 2014-11-23 at 21:35 +0200, Jouni Malinen wrote:
> On Sat, Nov 15, 2014 at 01:28:20AM +0000, James Harper wrote:
> > I just threw this patch together. It runs the 'ovs-vsctl port-to-br' command to determine the name of the bridge, falling back to the old bridge detection method if that fails.
> > 
> > It could be further developed to also add and remove the interface etc, but that's not really the way openvswitch works - interfaces are sticky wrt bridge membership and you don't need to re-add them each boot etc.
> > 
> > Another option would be to add a config parameter that says "don't do any bridge configuration".
> 
> I cannot really claim to be familiar with Open vSwitch and why it would
> be used with a WLAN interface, so could you please provide some more
> details on what exact fails without this change? Do you configure the
> bridge=<ifname> parameter in hostapd.conf? If so, does this fail with
> "nl80211: Adding interface .. into bridge .."?
> 
> The default behavior in hostapd will likely need to continue to manage
> some bridge cases, e.g., due to limitations on WLAN interface not being
> allowed to be add to Linux bridge in station mode (i.e., it needs to
> happen only after hostapd has been started). While it would be possible
> to do something external to manage this, I'm not aware of very good ways
> of doing that (especially with dynamic VLAN interface addition adding
> complexity).
> 
> I think I'd rather handle Open vSwitch in as simple way as possible and
> that may indeed be that not doing anything apart from providing the
> bridge ifname in hostapd.conf so that packet sockets can be bound to
> receive frames from the correct interface.
> 
> Would it be simpler to detect that the configured bridge netdev is Open
> VSwitch case rather than the Linux bridge? I'd assume the latter could
> at least be identified pretty easily, so the linux_br_add_if() call
> could be skipped if brname is not recognized as the Linux bridge.

OVS bridges aren't regular Linux bridge devices, so you can't use the
standard linux bridge detection mechanism.  They are really just
passthrough netdevs that put most of the flow logic and switching
decisions in userspace.

They do return 'openvswitch' as the driver name for ETHTOOL_GDRVINFO, or
you can look at the 'driver' link for the device in sysfs which will be
"openvswitch".

But unfortunately I think you do need ovs-vsctl for adding/removing
ports to/from the OVS bridge netdev.  I don't believe there's a way to
do it with netlink.

Dan



More information about the HostAP mailing list