Commit Graph

137 Commits

Author SHA1 Message Date
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 b2bfb572a3 openvswitch: fix build with libunbound
Due to a copy-paste error, libopenvswitch is missing a dependency when
Open vSwitch is configured to use unbound:

Package openvswitch-libopenvswitch is missing dependencies for the following libraries:
libunbound.so.8

Use the correct config symbol to solve this.

Fixes: 45c8cc9d8a ("openvswitch: make libunbound optional")
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 5423522944 openvswitch: check correct config symbol
The config symbol is named CONFIG_OPENVSWITCH_WITH_LIBUNBOUND, so check
for that instead of the non-existent CONFIG_OPENVSWITCH_WITH_UNBOUND.

Fixes: 45c8cc9d8a ("openvswitch: make libunbound optional")
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-27 23:52:44 +03:00
Stijn Tintel 45c8cc9d8a openvswitch: make libunbound optional
Installing openvswitch on an x86/64 snapshot image pulls in a bunch of
dependencies, good for a total size of 3648406 byte. Disabling
libunbound reduces that with 559941 byte, for a total of 3088465 byte.
This is quite a big reduction for a small tradeoff: without libunbound,
hostnames can not be used to specify OpenFlow managers or controllers.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-26 18:25:13 +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
Stijn Tintel 261961a33c openvswitch: refresh patches
CI run fails due to dirty patches, so refresh them.

Fixes: f4f1a25e80 ("openvswitch: bump to version 2.15.0")
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
Yousong Zhou f4f1a25e80 openvswitch: bump to version 2.15.0
Quote NEWS item

>   - Building the Linux kernel module from the OVS source tree is
>     deprecated
>     * Support for the Linux kernel is capped at version 5.8
>     * Only bug fixes for the Linux OOT kernel module will be accepted.
>     * The Linux kernel module will be fully removed from the OVS source
>       tree
>       in OVS branch 2.18

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2021-02-24 20:36:27 +08:00
Ilya Lipnitskiy 5d8d4fbbcb
treewide: Run refresh on all packages
The crude loop I wrote to come up with this changeset:

  find -L package/feeds/packages/ -name patches | \
  sed 's/patches$/refresh/' | sort | xargs make

Signed-off-by: Ilya Lipnitskiy <ilya.lipnitskiy@gmail.com>
2021-02-20 16:02:15 -08: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
Adrian Schmutzler 4b65ea569a openvswitch: remove support for kernel 4.14 and 4.9
Support for kernel 4.14 has been removed in main repo, so drop the
dependencies here as well (and those for even older 4.9).

Also drop a patch that is required only for 4.14 and lower.

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
2020-09-02 22:58:15 +08:00
Yousong Zhou 282038d97b openvswitch: bump to version 2.14.0
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-08-25 15:50:32 +08:00
Matthias Schiffer 8bb7659f08 openvswitch: backport patch to fix build against kernel 4.14.193
(and possibly other recent stable kernels)

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2020-08-15 09:19:59 +08:00
Yousong Zhou 3f383103ee openvswitch: bump to version 2.13.1
The two backported patches are included in 2.13.1

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-08-10 20:38:49 +08:00
Yousong Zhou a00671bf86 openvswitch: remove explicit dependency on librt
Selection of librt will be handled by the build system

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-07-30 11:54:34 +08:00
Yousong Zhou 52e074411b openvswitch: only libopenvswitch depends on libunbound, libunwind
This is to make explicit the conditional select of libunwind is only
needed for libopenvswitch.  If we spill it over other packages, the
generated kconfig will have recursive dependency issue.  2 new patches
were made for this goal

The other thing is that "+libunwind" will cause it to be built if any of the
packages defined in this Makefile is enabled (y or m).  This is at the moment
by-design of the build system.

Libunwind does not support architectures like arc.  Use conditional select To
avoid (libunwind) build failures like the following,

  checking for ELF helper width... configure: error: Unknown ELF target: arc
  make[3]: *** [Makefile:65: /data/openwrt/build_dir/target-arc_arc700_uClibc/
  libunwind-1.3.1/.configured_68b329da9893e34099c7d8ad5cb9c940] Error 1

Things like "+PACKAGE_openvswitch-libopenvswitch:libunwind" will also result in
recursive deps error for chains of 3 nodes.  Kconfig construct like the
following will be made

	config A
		tristate
		select B
		depends on !(C) || (x)

	config B
		tristate
		select C

	config C
		tristate

	config x
		bool

Other changes include

 - Shared use of variable ovs__common_depends was removed
 - Ovn doc build was patched out

Link: https://github.com/openwrt/packages/pull/12959#issuecomment-665021413
Reported-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-07-30 10:02:13 +08:00
Yousong Zhou f69f4f3fae openvswitch: rename shared var name ovs{,_}_common_depends
To avoid conflict with package ovs_common_depends of package
openvswitch-common

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-07-30 10:02:13 +08:00
Yousong Zhou acca35d460 openvswitch: backport patch fixing build for 4.14.187
Supersedes openwrt/packages#12932

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-07-30 10:02:13 +08: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 26291bba4e openvswitch: pass KERNEL_MAKE_FLAGS for reproducible build
Reported-by: Paul Spooren <mail@aparcar.org>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-05-27 16:38:56 +08:00
Yousong Zhou 931ff98633 openvswitch: rework disabling docs build
This is needed since openvswitch 2.13 commit 2a97891eb23b
("Documentation: Work with sphinx-build for Python 3 also.")

The 4th patch was also reworked to serve as another guard

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-05-27 16:38:56 +08:00
Yousong Zhou 1091badd83 openvswitch: fix file generation in /etc/modules.d
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Reported-by: Paul Spooren <mail@aparcar.org>
2020-05-20 23:29:44 +08:00
Huangbin Zhan 0ec746ccb6 treewide: add conffiles
Signed-off-by: Huangbin Zhan <zhanhb88@gmail.com>
2020-05-09 06:06:43 +08:00
Jeffery To 1bc2f4f3c6 treewide: Remove Python variants for non-Python packages
This removes Python-related build variants, and adds
PYTHON3_PKG_BUILD:=0 and minor build adjustments (where appropriate),
for non-Python packages. There should be no changes to build output.

This also updates some include paths for python3-package.mk and/or
python3-host.mk to be relative to the package Makefile.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
2020-04-19 01:56:23 +08:00
Yousong Zhou 88dcd09487 openvswitch: depend on IPV6 for intree kmods
Ref: https://github.com/openwrt/packages/issues/11665
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-03-26 15:50:34 +08:00
Yousong Zhou 07d6310d2f openvswitch: unset CONFIG_AUTOREMOVE
Phase 2 buildbots with this option enabled will cleanup openvswitch
build dir which is needed later when building ovn

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-03-26 15:50:34 +08:00
Yousong Zhou 0fa07ed578 openvswitch: openvswitch.mk: add ovs_common_depends variable
This is to address the need that openvswitch starting with 2.13 now
depends on libunwind for handling SIGSEGV (upstream commit e2ed6fbeb18
("fatal-signal: Catch SIGSEGV and print backtrace"))

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-03-24 10:45:57 +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 e9d6414437 openvswitch: fix PIE build against 4.14 kernel
Reported-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
Ref: https://github.com/openwrt/packages/pull/11567
2020-03-16 15:26:17 +08:00
Yousong Zhou d0dc891c14 openvswitch: bump PKG_RELEASE
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-01-08 11:54:47 +08:00
Yousong Zhou 7cc9c437be openvswitch: fix building failure caused by dst_ops api change
Ref: https://github.com/openwrt/packages/issues/10961
Reported-by: Sven Roederer <devel-sven@geroedel.de>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-01-08 11:54:46 +08:00
Yousong Zhou 99ecbf7f40 openvswitch: configure with --disable-silent-rules
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2020-01-08 11:54:46 +08:00
Josef Schlehofer 00eda4bb0d openvswitch: backport patch to fix compilation
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2019-10-25 11:15:50 +08:00
Lech Perczak ca81022a27 openvswitch: fix conditions for Linux 4.14
Condition testing for Linux version 4.14 is spelled LINUX_4_14, not
LINUX_4.14, so the checks were ineffective up to this change.
This Fixes the following error which appeared after update to 2.12.0,
when built against kernel 4.14:
Package kmod-openvswitch-intree is missing dependencies for the
following libraries:
tunnel6.ko

Signed-off-by: Lech Perczak <lech.perczak@gmail.com>
2019-09-29 17:29:59 +08:00
Jan Pavlinec 299e5b0a9b
treewide: add PKG_CPE_ID for better cvescanner coverage
Signed-off-by: Jan Pavlinec <jan.pavlinec@nic.cz>
2019-09-17 12:40:26 +02:00
Yousong Zhou feacaa5f80 openvswitch: bump to version 2.12.0
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-09-16 07:59:31 +00:00
Yousong Zhou 8897ea4d51 openvswitch: conditionally depends on nf_conncount.ko
This is required for conntrack zone limit support.  Linux upstream
commit is 11efd5cb ("openvswitch: Support conntrack zone limit")

Ref: https://github.com/openwrt/packages/issues/9274#issuecomment-507181166
Reported-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-07-01 13:45:38 +00:00
Yousong Zhou 6aef8faae7 openvswitch: bump to version 2.11.1
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-06-20 08:35:31 +00:00
Yousong Zhou 51a68f08c5 openvswitch: drop dependencies on kmod-mpls
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-06-20 08:35:31 +00:00
Yousong Zhou 885fc52411 openvswitch: conditionally select kmod-nsh
The nsh.ko requirement was introduced in kernel 4.15.  Currently there
are 3 kernel versions in base system, 4.9, 4.14, 4.19

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-06-20 08:35:31 +00:00
Yousong Zhou a6ec885522 openvswitch: rework skipping intree kmod build for unsupported kernels
This is a workaround to prevent the whole build from failing because of
the intree kmods are not supported yet by upstream project.

Root cause is that kernel version should not play a part when making
DEPENDS as the generated kconfig was for all targets that may have
different kernel versions.

One less than ideal effect of this change is that for an unsupported
kernel version, people can still select the intree kmod but it won't be
built.  This may contradict expectation if the warning was not noticed
by them

Resolves openwrt/packages#9274

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-06-20 08:24:55 +00:00
Yousong Zhou 3680e969b1 openvswitch: fix compilation of intree datapath kmod
Reference: https://github.com/openwrt/packages/issues/8548#issuecomment-488871090
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-05-03 17:53:03 +00:00
Yousong Zhou 989ef5d414 openvswitch: switch to using python3 both on build and target machine
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-04-26 21:03:37 +08:00
Yousong Zhou 21ac0adcd2 openvswitch: add openvswitch-python3 package
Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
2019-04-26 21:03:37 +08:00