Commit Graph

49 Commits

Author SHA1 Message Date
Stan Grishin 4c934aea71 miniupnpd: remove uci-defaults and fw4-include files for nftables variant
* remove firewall4.include file as it is not needed and procuces a firewall
  error on service miniupnpd restart
* remove the uci-defaults file as its sole purpose was to install the
  firewall include file
* modify the Makefile to reflect the deleted files

Signed-off-by: Stan Grishin <stangri@melmac.ca>
2023-08-25 17:59:22 +00:00
Stijn Tintel f7c0e413f4 miniupnpd: bump to 2.3.3
Fixes: #19637
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2023-03-10 01:59:26 +02:00
Jo-Philipp Wich f1c69d0e6c miniupnpd: rework firewall4 integration
- Bump to the latest Git version in order to increase the package version
   for simpler opkg upgrade of the broken version

 - (Re-)Introduce PKG_RELEASE into the package, omitting it may lead to
   opkg segmentation faults under certain circumstances

 - Utilize automatic include hooks to drop the isolated miniupnpd table
   in favor to chains within the main inet fw4 table, otherwise PCP is
   unreliable as the upnp table might accept traffic which is later
   rejected by fw4

 - Install a fw4 script hook to restart miniupnpd on fw4 restarts and
   reloads in order to repopulate the upnp chains with forward rules

 - Register the used miniupnpd configuration file and the firewall uci
   configuration as change sources, otherwise `/etc/init.d/miniupnpd reload`
   has no effect if the firewall or upnpd config was changed

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
2022-09-06 20:28:11 +02:00
Tiago Gaspar 651a578cac miniupnpd: update and fix nftables variant
Update the package to a commit that fixes an issue with removing PCP
mappings from nftables.
This also allows us to fix the nftables miniupnpd implementation on
openwrt.
In this new implementation, a table is created at the start of miniupnpd
and it is dedicated to miniupnpd with a priority above the firewall4
table. This allows miniupnpd to go ahead of the drop rules of firewall4
and forward traffic as needed. There was the possibility of adding a
chain inside the firewall4 table, but this would raise an issue where
if firewall4 was reloaded the port forwardings would be lost and
miniupnpd could be out of sync. When miniupnpd is stopped the table is
deleted, taking the port forwardings with it.

Some of this commit is based of msylgj's work, mainly the logic of the
init/hotplug scripts and the makefile build parameters.

Signed-off-by: ZiMing Mo <msylgj@immortalwrt.org>
Signed-off-by: Tiago Gaspar <tiagogaspar8@gmail.com>
2022-08-25 00:40:19 -07:00
Josef Schlehofer 0bc25077b3
Revert "miniupnpd: bump to latest git source"
This was reverted because the commit does more things than just "bump to
latest git source". Also, it was not properly reviewed/tested.

See: https://github.com/openwrt/packages/pull/18133#issuecomment-1106346788

This reverts commit b3b911e992.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2022-04-22 17:20:39 +02:00
ZiMing Mo b3b911e992 miniupnpd: bump to latest git source
Signed-off-by: ZiMing Mo <msylgj@immortalwrt.org>
2022-04-14 19:01:03 -07:00
Hannu Nyman 569f3710fe miniupnpd: declare nftables variant as DEFAULT_VARIANT
Declare the nftables variant as the DEFAULT_VARIANT
as nftables firewall4 is the now default in OpenWrt.

Additionally,
 * toggle CONFLICTS placement to avoid circular dependency warning
 * use AUTORELEASE

Signed-off-by: Hannu Nyman <hannu.nyman@iki.fi>
2022-01-26 13:11:05 -05:00
Stijn Tintel 7fbc5d4db3 miniupnpd: create iptables and nftables variant
The next OpenWrt stable release aims to use firewall4 by default. As
this uses nftables as backend, miniupnpd will no longer work. Create an
iptables and nftables variant of the miniupnpd package so that miniupnpd
can be used with either firewall variant.

See #16818 for more info.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-01-05 11:00:02 +02:00
Stijn Tintel 23ba57418c Revert "miniupnpd: introduce IGDv1 variant"
Since version 2.2.3, miniupnpd will detect MS clients and force IGDv1.

This reverts commit 7f5534ac7a.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2022-01-05 11:00:02 +02:00
Shaleen Jain c2e846dae6 miniupnpd: update to version 2.2.3
Signed-off-by: Shaleen Jain <shaleen@jain.sh>
2022-01-05 08:18:38 +01:00
Josef Schlehofer 107f3376b5
Revert "net/miniupnpd: ext_ip_reserved_ignore support"
This patch is causing several issues [1], which then were reported to
upstream [2] and it was not accepted by upstream [3]. This results that
nobody maintain this custom patch and it is not useful as it is changing
addr_is_reserved behavior.

[1] https://github.com/openwrt/packages/issues/15258
[2] https://github.com/miniupnp/miniupnp/issues/542
[3] https://github.com/miniupnp/miniupnp/pull/511

This reverts commit b76aa99194.

Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
2021-07-19 14:03:37 +02:00
Stan Grishin dc881068b9 miniupnpd: disable ext_ip_reserved_ignore by default; fix grammar
Signed-off-by: Stan Grishin <stangri@melmac.net>
2021-06-02 04:54:16 +00:00
Stijn Tintel b8f9e4354e miniupnpd: bump to 2.2.2
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-05-21 18:20:37 +01:00
Stijn Tintel 3836218ba6 miniupnpd: add missing dependencies
Fixes the build problem below.

Package miniupnpd is missing dependencies for the following libraries:
libmnl.so.0
libnetfilter_conntrack.so.3

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-05-21 18:20:37 +01:00
Stijn Tintel 5651b45029 miniupnpd: reformat dependencies
Use multiple lines and order alphabetically for improved readability.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-05-21 18:20:37 +01:00
Rosen Penev 37f4d88cf2
Merge pull request #14656 from stintel/miniupnpd
miniupnpd: introduce IGDv1 variant
2021-04-16 18:24:36 -07:00
Kevin Darbyshire-Bryant 679a7b69ee miniupnpd: add patience to firewall include
Occasionally, mostly at startup, miniupnpd reports "Another app is
currently holding the xtables lock. Perhaps you want to use the -w
option?"

Take iptables' advice and wait up to 1 second before giving up.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2021-03-20 16:01:25 +00: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
Stijn Tintel 7f5534ac7a miniupnpd: introduce IGDv1 variant
Microsoft Windows, Xbox and possibly other operating systems do not
support IGDv2. With IGDv2 enabled, they send a HTTP GET request for
rootDesc.xml and WANIPCn.xml, and then nothing happens. The Microsoft
implementation probably doesn't like the WANIPCn.xml response and
decides UPnP is not available. When miniupnpd is built without IGDv2
support, after the 2 HTTP GET requests, there is a HTTP POST request to
/ctl/IPConn, and miniupnpd configures the port forward as expected.

The runtime option force_igd_desc_v1=yes (UCI: igvd1) does not solve
this problem. It's possible this was enough in earlier miniupnpd
versions, but it does not fix the problem the current version.

Since we are a modern distro, we want to support the latest and
greatest, so we should default to IGDv2 enabled. Introducing a
menuconfig option to disable IGDv2 would only help people who build
their own images, so offer a separate package variant for IGDv1.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-02-04 22:51:45 +02:00
Syrone Wong 5eb01b5a3e net/miniupnpd: update to 2.2.1
Signed-off-by: Syrone Wong <wong.syrone@gmail.com>
2021-01-01 22:15:37 +08:00
Jitao Lu c89a1f3e8b miniupnpd: Don't override ipv6_listening_ip
Fixes: https://github.com/openwrt/packages/issues/14145
Signed-off-by: Jitao Lu <dianlujitao@gmail.com>
2020-12-07 11:53:30 +08:00
Jitao Lu 7077fd8c79 miniupnpd: Pass ipv6 addr to ipv6_listening_ip
Unlike ipv4, this option is supposed to be an IP address, otherwise, an
error occurs on startup:

    can't parse "br-lan" as valid IPv6 listening address

Signed-off-by: Jitao Lu <dianlujitao@gmail.com>
2020-12-03 23:36:09 +08:00
Chen Minqiang b76aa99194 net/miniupnpd: ext_ip_reserved_ignore support
This add an option to ignore ext_ip reserved
Enable this option in config by default.

Fixes: #13773

Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2020-11-26 15:56:20 +08:00
Marco Martins 773b87977e
miniupnpd: Added chain rule to filter table so udp stun incoming connections rules works
Signed-off-by: Marco Martins <marcomartins86@gmail.com>
2020-11-25 14:12:18 -08:00
Rosen Penev 4d824243e6
miniupnpd: update to 2.2.0
Replace daemon patch with upstream solution.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-11-25 14:10:41 -08:00
Chen Minqiang 67b4871322 net/miniupnpd: check by /etc/init.d/miniupnpd running
Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
2020-08-08 00:12:38 +08:00
Rosen Penev 7891124d6c
miniupnpd: default to IGDv1
It seems even modern stuff doesn't support v2 correctly. The miniupnp
suite does but other stacks seem to lack support. Default to v1 to
avoid the headache.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-07-08 14:17:23 -07:00
Rosen Penev d68b660569
Merge pull request #12674 from ldir-EDB0/miniupnpd
miniupnpd: macosx compat and refresh patches
2020-07-01 22:49:16 -07:00
Alexey Kuznetsov 9b6537b487 miniupnpd: add miniupnpd ipv6_disable option, #11971 close
Signed-off-by: Alexey Kuznetsov <axet@me.com>
2020-07-02 06:20:13 +03:00
Kevin Darbyshire-Bryant 0189c45253 miniupnpd: macosx compat and refresh patches
Tidy up some minor patch fuzz with a refresh.

Also tweak the linux makefile to make it run on macosx and linux:
install only understand -m for filemode, not that the openwrt staging
dir understands file modes.  Also glibc>2.17 so patch out the check that
otherwise barfs a number of errors from a missing 'ldd' command under
macos.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-07-01 10:16:43 +01:00
Rosen Penev ba49c96808
miniupnpd: added libcap-ng dependency
As miniupnpd is running as root, libcap(-ng) can be used to limit its
capabilities.

libcap-ng is very small, so this isn't a problem.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-27 15:15:14 -07:00
Rosen Penev 2b5028458e
miniupnpd: update to 2.1.20200510
Use the newly introduced configure script.

Use PKG_INSTALL for consistency between packages.

Use PKG_BUILD_PARALLEL for faster compilation.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-06-25 17:44:23 -07:00
David Ehrmann 6ef2b5400b miniupnpd: suppress grep and uci errors
If miniupnpd is installed but disabled or not running, the hotplug
script will query uci for keys that don't exist and grep a temporary
config file that doesn't exist, resulting in the following errors:

uci: Entry not found
grep: /var/etc/miniupnd.conf: No such file or directory

These would arise when an interface is brought up or down, and are
more confusing than helpful, especially when miniupnpd is disabled.

Suppress these errors.

Signed-off-by: David Ehrmann <ehrmann@gmail.com>
2020-06-20 20:48:29 -07:00
Kevin Darbyshire-Bryant 295d77943c miniupnpd: improve hotplug & interface handling
The existing interface selection/detection code was incomprehensible at
worst and convoluted at best.  The uci config file suggested it
understood an external ipv6 interface but in reality the init script
took no notice.  Re-work it so it is at least comprehendible and takes
notice of ipv6 interface details if specified.

Update the hotplug script to use the same interface selection/detection
code as the init script and take note of ipv6 interface selection, only
restarting miniupnpd on interface up events and only if that interface
isn't already known (for that ip class) by miniupnpd.

For me this has solved numerous 'flaky' startup problems, especially
with regard to ipv6.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-05-25 22:49:03 +01:00
Kevin Darbyshire-Bryant b7c59c390f miniupnpd: make hotplug work again
hotplug scripts are sourced not exec'd so #!/bin/sh /etc/rc.common
doesn't pull in the functions defined in /etc/rc.common thus since
'enabled' isn't defined the following sequence always fails:

enabled miniupnpd || exit 0

Unfortunately sourcing /etc/rc.common doesn't appear to work so come up
with some alternatives.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-05-10 17:30:11 +01:00
Kevin Darbyshire-Bryant 0f1e7d32af miniupnpd: fix sh syntax error
Add "use_stun" default to prevent sh: out of range error introduced by
c61614a84

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2020-03-30 13:19:02 +01:00
Rosen Penev c61614a849
miniupnpd: convert to procd
Massive cleanup of the shell script. Many issues were fixed.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-02-13 15:34:25 -08:00
DENG Qingfang fcf72ceec4 miniupnpd: update to 2.1.20191006
Removed upstreamed patch:
100-build-on-OpenWrt.patch

Signed-off-by: DENG Qingfang <dengqf6@mail2.sysu.edu.cn>
2019-10-12 14:54:26 +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
Rosen Penev ee4a1c0c09
miniupnpd: Fix compilation under glibc
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-04-27 12:01:45 -07:00
Rosen Penev 96f50729ad
miniupnpd: Update to 2.1.20190408
Refreshed patch.

Added PKG_LICENSE_FILES.

Added --as-needed linker flag for slightly smaller size.

Removed -O2 hack to get it to compile. As part of this, removed a bunch of
CFLAGS that are normally passed which potentially affect compilation with
Os.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-04-13 17:04:23 -07:00
Rosen Penev 8dc7472705 miniupnpd: Update to 2.1.20180706
Switched to upstream mirror 2, which is reachable over HTTPS.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2018-08-04 11:55:33 -07:00
Kevin Darbyshire-Bryant d5aaba2702 miniupnpd: remove my maintainership
Practicalities of life have intervened and I am no longer able to
dedicate the time required to look after this package.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-08-02 22:30:31 +01:00
Kevin Darbyshire-Bryant 48d9c84a99 miniupnpd: fix build error when ASLR enabled
Add -fPIC to TARGET_LD_FLAGS

ce9TpAS.ltrans0.ltrans.o: relocation R_MIPS16_26 against `syslog' can not
be used when making a shared object; recompile with -fPIC
cce9TpAS.ltrans0.ltrans.o: error adding symbols: Bad value

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-06-08 15:25:09 +01:00
Kevin Darbyshire-Bryant 762e8b0f17 miniupnpd: bump to v2.1 20180508
Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-05-13 19:01:44 +01:00
Kevin Darbyshire-Bryant 569ed29e63 miniupnpd: change leasefile location
Move default leasefile location from /var to /var/run.
Also rename from upnp.leases to miniupnpd.leases

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-05-09 20:02:29 +01:00
Kevin Darbyshire-Bryant 2777953325 miniupnpd: build with gc-sections & LTO
Building with --gc-sections & -flto drop ipk size from 72600 to 66345
on MIPS

No misbehaviour due to these optimisations observed.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-05-09 20:02:17 +01:00
Kevin Darbyshire-Bryant 079e57bbd1 miniupnpd: bump to 2.0.20180503
Bumping to latest release.  No (used) functional difference.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-05-08 14:32:55 +01:00
Kevin Darbyshire-Bryant a2e2eeb409 miniupnpd: Import release 20180422 to repo
Import miniupnpd from routing repo and bump to 20180422.

Drop 102-ipv6-ext-port.patch as this looks upstreamed in the pinhole
code to me.
Consolidate all other patches & update with a view to sending upstream.

Add support for runtime IGDv1 mode switch (default to IGDv2)

(not extensively) Tested-on: ar71xx Archer C7 v2 in IGDv1 compatibility
mode.  A variety of devices/applications appear to be able to create
mappings.

Have an attempt at resolving https://github.com/openwrt-routing/packages/issues/286
TL;DR miniupnpd rules get processed before fw3 rules and thus can
override existing/intended redirects.  Ideally the miniupnpd rules would
be last in the relevant chains, unfortunately fw3 can sometimes use the
last rule as a REJECT.  Put miniupnpd rules as penultimate.

Signed-off-by: Kevin Darbyshire-Bryant <ldir@darbyshire-bryant.me.uk>
2018-05-04 09:03:56 +01:00