Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indefinitely duplicated ip/port in os-upnp #3831

Closed
roylaprattep opened this issue Feb 16, 2024 · 25 comments
Closed

Indefinitely duplicated ip/port in os-upnp #3831

roylaprattep opened this issue Feb 16, 2024 · 25 comments
Labels
upstream Third party issue

Comments

@roylaprattep
Copy link

roylaprattep commented Feb 16, 2024

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

My last bug report was deleted. Can you please solve, give me a workaround or a direction I can go before closing... Instead of manual port forward.

There is a serious bug with os-upnp since latest version fresh install. The status list is deduplicating same entries again and again which means that the status log is growing indefinitely.

Everything was working perfectly fine on 23.7 and associated version.

Thank you very much guys.

To Reproduce

Go to "Services"
Click on "Universal Plug and Play"
Then click "Status"
See bug

Expected behavior

One entry per port/IP.

Screenshots

image
image
image

Environment

-OPNsense 24.1.1-amd64
-FreeBSD 13.2-RELEASE-p9
-OpenSSL 3.0.13
-os-upnp 1.5_6
-Intel(R) Core(TM) i5-3450 CPU @ 3.10GHz (4 cores, 4 threads)
-Intel X520-DA2 E10G42BTDA PCI-E Dual Port 10G SFP+ NIC Server Adapter (Configured with LAG/LACP)

@roylaprattep roylaprattep changed the title os-upnp duplicating entries in status tab os-upnp duplicate ip/port indefinitely Feb 17, 2024
@roylaprattep roylaprattep changed the title os-upnp duplicate ip/port indefinitely Indefinitely duplicated ip/port in os-upnp Feb 17, 2024
@fichtner
Copy link
Member

It's probably a kernel bug due to pfctl fiddling or the new miniupnpd pfctl patching in FreeBSD ports. If you want to take it to the appropriate authority go to https://bugs.freebsd.org/bugzilla/ and give them the raw command line output of the respective FreeBSD commands saying the problem is on stable/13.

Cheers,
Franco

@fichtner fichtner added the upstream Third party issue label Feb 17, 2024
@roylaprattep
Copy link
Author

Hi @fichtner,

OPNsense team can't do nothing? When I was on last 23.7.11, someone gave me a command to use the upnp package from 23.7.10 (while still on 23.7.11). Is there a way to achieve the same thing on 24.1.1?

Otherwise, I don't know what to send to FreeBSD bug report.

Thank you for your reply.

@fichtner
Copy link
Member

fichtner commented Feb 17, 2024

Well we can help mitigate but it’s a Saturday and I have a rather large tree to deal with at the moment. 😉

@roylaprattep
Copy link
Author

@fichtner

Haha, ok. I can wait, no worries.

Thank you.

@roylaprattep
Copy link
Author

Anyone would like to mitigate this issue please? Any good samaritains? :P

Would be greatly appreciated, I'll pay next beer.

Thank you.

@fichtner fichtner transferred this issue from opnsense/core Feb 20, 2024
@fichtner
Copy link
Member

@roylaprattep does this bring it back?

# pkg add -f https://pkg.opnsense.org/FreeBSD:13:amd64/23.7/MINT/23.7.10/latest/All/miniupnpd-2.3.3_1,1.pkg

Cheers,
Franco

@CrazyCoder
Copy link

CrazyCoder commented Feb 22, 2024

Looks exactly as my issue described at https://forum.opnsense.org/index.php?topic=38732.0.

UPnP clients get corrupted mappings from OPNsense miniupnpd server :(

does this bring it back?

@fichtner not in my case. I had the same issue on 23.7 (don't remember when exactly it started, but I'm new to OPNsense and have been using it only for ~2 months), and 24.1 cannot install this package because of:

pkg: Missing dependency 'openssl111'
Failed to install the following 1 package(s): https://pkg.opnsense.org/FreeBSD:13:amd64/23.7/MINT/23.7.10/latest/All/miniupnpd-2.3.3_1,1.pkg

@fichtner
Copy link
Member

Ok, bummer. Please report to https://bugs.freebsd.org

Cheers,
Franco

@CrazyCoder
Copy link

Reported https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277226.

Not sure what other information they will need.

@roylaprattep
Copy link
Author

@fichtner

Unfortunately not. :/

@roylaprattep
Copy link
Author

This issue has been resolved upstream: miniupnp/miniupnp#719

Please update this FreeBSD port to the latest version in order to resolve this issue.

@fichtner
Copy link
Member

That leaves the complication that FreeBSD ports has custom patch glue that no longer applies to 2.3.6.

Still, the whole timing issue here is off so I wouldn't bet on this horse just yet.

Cheers,
Franco

@roylaprattep
Copy link
Author

Just to know it's gonna be taken care of sooner or later, is nice. As for the "when", I don't think there is a hurry here... If, and when it is done, just let us know brother.

Thanks Franco.

@MorningLightMountain713

Just to know it's gonna be taken care of sooner or later, is nice. As for the "when", I don't think there is a hurry here... If, and when it is done, just let us know brother.

Thanks Franco.

If you're desperate (like I was :P) You can go to the miniupnpd website, and download the source, and compile. I can confirm this issue is resolved on the new version. (2.3.6)

@denverpilot
Copy link

Tempted to do that too @MorningLightMountain713 but leery because of @roylaprattep 's comment that ports has glue... wonder what the glue is for... if your compiled version is behaving fine... hahaha...yuck...

@Sjors
Copy link

Sjors commented May 28, 2024

@MorningLightMountain713 when you built from source, did you do (more than) this?

Delete lines with MAN from Makefile.bsd

./configure --ipv6 --firewall=pf
make
make install

See also https://cgit.freebsd.org/ports/tree/net/miniupnpd/Makefile

@fichtner
Copy link
Member

fichtner commented May 28, 2024

FreeBSD complications with libpfctl use are problematic. I don't know the impact building without it. A patch is available here now... https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=277226

@fichtner
Copy link
Member

A snapshot with the update has been published:

# opnsense-revert -z miniupnpd

Feedback welcome.

Cheers,
Franco

@CrazyCoder
Copy link

CrazyCoder commented May 29, 2024

@fichtner

Hmm, I just updated to 24.1.8 and the command above doesn't seem to install the right version?

root@gw:~ # opnsense-revert -z miniupnpd
Fetching miniupnpd.pkg: ... done
Verifying signature with trusted certificate pkg.opnsense.org.20240105... done
miniupnpd-2.3.3_3,1: already unlocked
Installing miniupnpd-2.3.3_3,1...
package miniupnpd is already installed, forced install
Extracting miniupnpd-2.3.3_3,1: 100%
=====
Message from miniupnpd-2.3.3_3,1:

--
*** !!WARNING!! !!WARNING!! !!WARNING!! ***
This port allows machines within your network to create holes in your
firewall.  Please ensure this is really what you want!
*** !!WARNING!! !!WARNING!! !!WARNING!! ***

For this daemon to work, you must modify your pf rules to add an anchor
in both the NAT and rules section.  Both must be called 'miniupnpd'.
Example:

# NAT section
# UPnPd rdr anchor
rdr-anchor "miniupnpd"

# Rules section
# uPnPd rule anchor
anchor "miniupnpd"

@fichtner
Copy link
Member

@CrazyCoder not the main mirror then. still syncing on this one you have set up

@CrazyCoder
Copy link

@fichtner Thanks, indeed, switched to the default mirror (https://pkg.opnsense.org/FreeBSD:13:amd64/24.1) and it worked:

Installing miniupnpd-2.3.6,1...
package miniupnpd is already installed, forced install
Extracting miniupnpd-2.3.6,1: 100%

@fichtner
Copy link
Member

@CrazyCoder update worked or the fix too? ;)

@CrazyCoder
Copy link

@fichtner The update and the fix. I did a quick test with https://github.com/kaklakariada/portmapper. Adding/removing mappings works, and there are no more duplicates or corrupted records.

@denverpilot
Copy link

@fichtner working properly now here also, when testing the updated miniupnpd. No duplicate ports. Thank you for your work.

@fichtner
Copy link
Member

Ok I'll close then! Thanks all :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream Third party issue
Development

No branches or pull requests

6 participants