Commit graph

18 commits

Author SHA1 Message Date
Stijn Tintel
596051c77e openvswitch: bring up member ports
Open vSwitch does not bring up ports automatically. This is not a
problem for wireless ports, or for ports configured in
/etc/config/network, but other ports will be down, and require manual
interaction to be brought up. Configuring them with proto none will
cause netifd to do some actions on them, which might cause undefined
results, and will also bloat the UCI config file.

The cleanest solution is to bring all member ports up as part of the
init script.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-11-19 14:15:42 +08:00
Stijn Tintel
9e45d45348 openvswitch: add option for failure mode
When Open vSwitch is configured to use a controller, but is unable to
connect to it, Open vSwitch will setup flows to allow all traffic, if
the failure mode is not configured, or set to standalone.

As this might be a security hazard, it is also possible to configure
Open vSwitch in a secure failure mode. Enabling this mode causes Open
vSwitch to drop all traffic if it is unable to connect to the
controller.

Redirect stderr of the command to /dev/null as it does not support the
--if-exists option.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-09-23 09:15:34 +08:00
Stijn Tintel
c05103da92 openvswitch: add option for OpenFlow datapath desc
Add a UCI config option to set the OpenFlow datapath description. This
allows setting a human readable description of the bridge, e.g.
"Building x, Floor y, AP z", which makes it easier to recognize the AP.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-09-22 20:40:45 +08:00
Stijn Tintel
653716eb19 openvswitch: add SSL support
Open vSwitch supports SSL to connect to an OpenFlow controller. This is
recommended for security. Expand the UCI ovs config section to allow
configuring SSL CA, certificate and private key.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-29 12:30:39 +03:00
Stijn Tintel
2430c4ef82 openvswitch: add missing basescript variable
The Open vSwitch init script does not set USE_PROCD=1. Instead, it
defines most of the functions and variables that would be set when
USE_PROCD is set to 1, but with some minor changes.

The basescript variable however, which is used when calling
procd_open_service and procd_kill, is not set. As a result, basename of
the contents of the initscript variable is used as the service name. As
the service is automatically started via its symlink in /etc/rc.d,
S15openvswitch, the service name is S15openvswitch.

Set the basescript variable so that the service name is openvswitch.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-29 12:30:22 +03:00
Stijn Tintel
4a4c1634e6 openvswitch: support setting OpenFlow datapath ID
By default, Open vSwitch will generate the OpenFlow datapath ID of a
bridge based on the MAC address of one of its ports. Due to this, it's
possible that the datapath ID changes when new ports are added. When the
datapath ID changes, Open vSwitch disconnects from the controller, as
there is no way to notify the controller that the datapath ID has
changed.

Add an option to set the datapath ID so that the above situation can be
avoided. The option takes either exactly 16 hex characters, or when
prefixed with 0x, between 1 and 16 hex characters.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-29 11:02:34 +03:00
Stijn Tintel
eff5adb9a3 openvswitch: allow complex port configurations
The current way to add ports to an Open vSwitch bridge does not allow
complex port configurations. Use a dedicated uci config section per port
instead of the current port:type syntax. This way we can easily support
more features like setting the VLAN tag or the OpenFlow port number.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-23 12:16:29 +03:00
Stijn Tintel
a5648280b3 openvswitch: only init bridges when (re)starting
Calling the ovs_bridge_init function when stopping the service will
result in ovs-vsctl being called after ovsdb-server has been shut down.
This causes the following error:

ovs-vsctl: unix:/var/run/openvswitch/db.sock: database connection failed (No such file or directory)

Calling the ovs_bridge_init function when requesting the service status
has no added value.

Only call ovs_bridge_init during start or restart to fix this.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-23 12:16:29 +03:00
Felix Fietkau
ec56b98a7e openvswitch: close flock fd when starting openvswitch services
Fixes deadlock with multiple init script calls

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-07-20 14:26:55 +02:00
Felix Fietkau
1038ac1235 openvswitch: add support for definining bridge ports in the config
Add limited procd support to handle config reload
Option drop_unknown_ports can be used to ensure that only configured ports
are part of the bridge

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2021-06-23 15:49:28 +02:00
Florian Eckert
7184a471ef openvswitch: use new extra_command function definition
Signed-off-by: Florian Eckert <fe@dev.tdt.de>
2020-11-04 08:50:34 +01:00
Simon Kinane
d7507146e8 openvswitch: adds new UCI section ovs_bridge
This new config section in package openvswitch
supports creating a named bridge, and setting
its' OpenFlow controller end-point.

An example config is included in /rom/etc/config/openvswitch

Signed-off-by: Simon Kinane <skinane@fb.com>
2020-07-28 12:46:17 +08:00
Yousong Zhou
bf4f584e75 openvswitch: bump to version 2.13.0
python2 library is now removed as the transition has been done by the
upstream project

OVN is now a separate project released with its own release plan and
it's not included within openvswitch starting with ovs 2.13.

openvswitch.mk is split out from the main Makefile for adding ovn
packages back in following commits.

The following two patches are already included in 2.13

 - ovsdb-idlc-fix-dict-change-during-iteration.patch
 - compat-Include-confirm_neigh-parameter-if-needed.patch

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-03-23 16:07:24 +08:00
Yousong Zhou
76e57b333d openvswitch: multiple fixes for 2.10
- initscript: skip when ctl scripts are absent.  When only ovs is
   installed, this will quash error messages of ovn-ctl not found when
   invoking stop
 - openvswitch-common: include ovs-kmod-ctl
 - patches: ovs-save: compatible with busybox ip command

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-09-09 09:51:14 +08:00
Yousong Zhou
c2f788f054 openvswitch: rework packaging
New scheme mainly provides three packages: openvswitch,
openvswitch-ovn-north, openvswitch-ovn-controller.  These should fit
most usage scenarios.  Other subpackages like openvswitch-libXXX
etc.  are there for dependency management and are hidden from the
menu.

Many python and shell scripts are removed in this revision.  Most of
them cannot run out of box at all for lack of dependencies.  Others
being legacy ones are not that useful now.  Add them back at later time
when real need appears

Below are a simple listing of additions

 - initscript now incorporate also ovn north and controller support
 - ovn-ctl and ovs-ctl can be invoked directly from within $PATH

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2018-06-04 11:27:54 +08:00
Alexandru Ardelean
1a53301cd1 openvswitch: upgrade to 2.8.1 ; package more stuff from the OVS build
I should have packaged the OVN stuff, VTEP and what-not
earlier, but was not inspired to do this earlier.

I made some time now to package those parts.

Disabling flake8 & python3 explicitly.
They might get detected and cause weird build errors.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-10-24 14:57:12 +03:00
Helmut Schaa
03515b807d openvswitch: Run with nice -10 (#1765)
This is default if ovs is started through ovs-ctl but we start it directly, hence
tell procd to use nice -10 for ovs.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
2014-09-22 18:10:48 +03:00
Alexandru Ardelean
8ecc0fb194 openvswitch: initial feed at OpenVSwitch version 2.3
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2014-09-16 17:13:46 +03:00