Bug 277226

Summary: net/miniupnpd: duplicate mappings, corrupted replies to clients
Product: Ports & Packages Reporter: Serge <sbaranov>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: New ---    
Severity: Affects Some People CC: alper, angel, boian_valentinov, diizzy, franco, kp, kristof, roylaprattep, squat, udingmyride, xpendable
Priority: --- Keywords: vendor
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch from May 8 none

Description Serge 2024-02-22 20:50:01 UTC
Originally discovered in OPNSense: https://github.com/opnsense/plugins/issues/3831.
See also https://forum.opnsense.org/index.php?topic=38732.0.

OPNsense 24.1.2_1-amd64
FreeBSD 13.2-RELEASE-p10
OpenSSL 3.0.13
miniupnpd 2.3.3

Over time, duplicate mappings like this are created:

```
62852	tcp	10.0.0.87	6690	upnpclient:6690
62852	tcp	10.0.0.87	6690	upnpclient:6690
62852	tcp	10.0.0.87	6690	upnpclient:6690
```

If you try to get the mapping list using miniupnpc, it returns corrupted results:

```
i protocol exPort->inAddr:inPort description remoteHost leaseTime
 0 UDP     0->10.0.0.87:0     '' '34.26.0.0' 0
 1 UDP     0->10.0.0.87:0     '' '34.26.0.0' 0
 2 UDP     0->10.0.0.87:0     '' '34.26.0.0' 0
```
Comment 1 roylaprattep 2024-02-22 22:38:55 UTC
+1 here.
Comment 2 Franco Fichtner 2024-02-23 08:31:44 UTC
There is definitely breakage here since https://github.com/freebsd/freebsd-ports/commit/81e8bb9834
Comment 3 boian_valentinov 2024-03-12 09:21:00 UTC
+1 here
Comment 4 udingmyride 2024-03-15 21:27:59 UTC
+1 here
Comment 5 xpendable 2024-04-15 15:13:03 UTC
This issue has been resolved upstream: https://github.com/miniupnp/miniupnp/issues/719

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

Also just a thought/question... shouldn't this be a part of a CI/CD process so that when the source gets updated the FreeBSD port also gets updated automatically?
Comment 6 AhnHEL 2024-04-20 17:54:12 UTC
Bumping +1 please.
Comment 7 AlpAne 2024-05-06 07:15:47 UTC
Another bump, +1! Please fix this one as soon as possible since it would improve quality of life for all users of UPNP.

Thanks in advance!
Comment 8 xpendable 2024-05-27 14:22:45 UTC
Hello,

I am curious as to why the pfSense FreeBSD port of this package has been updated first before the main FreeBSD port of this package?
https://github.com/pfsense/FreeBSD-ports/commit/6e7d96166c051915155356546474a1c6e68cf2aa

Is this due to netgate sponsoring the change?
If so is there some sort of delay/exclusivity that pfSense gets due to the sponsership before being merged into the main FreeBSD port?

Just seems odd to me that the main FreeBSD package would not be updated first and then all other downstream projects would then be subsequently updated.
Comment 9 Serge 2024-05-27 14:58:14 UTC
(In reply to xpendable from comment #8)

That's concerning, especially considering that the previous sponsored commit from the same person has broken what was working fine before. And now this issue has affected all FreeBSD users for many months.
Comment 10 Franco Fichtner 2024-05-27 15:14:02 UTC
Created attachment 251015 [details]
patch from May 8
Comment 11 Franco Fichtner 2024-05-27 15:15:49 UTC
Attached the GitHub patch and will ask for this to be assigned/handled.
Comment 12 Mark Linimon freebsd_committer freebsd_triage 2024-05-27 20:46:59 UTC
^Triage: with bugmeister hat, reset maintainer-feedback flag due to timeout.

To maintainer: it is not clear to me whether you ever saw this PR.  But
in either case, please let bugmeister@ and/or portmgr@ know if you are
still interested in maintaining this port.
Comment 13 roylaprattep 2024-05-28 01:10:16 UTC
(In reply to xpendable from comment #8)

It's OPNsense (Deciso) and not PFsense (Netgate).
Comment 14 Franco Fichtner 2024-05-28 04:41:48 UTC
(In reply to roylaprattep from comment #13)

You don't understand. net/miniupnpd was made barely maintainable due to libpfctl additions that are not going upstream.  This report was from OPNsense, but affects all FreeBSD users. Now pfSense has a fix written by the person who introduced libpfctl here in the first place, but did not fix it in FreeBSD. I have HIS patch attached.

Now we are still waiting from SOMEONE to step in and commit it here?

I don't think this is a fair/reasonable approach to bugs and maintaining software in the FreeBSD ports tree.


Cheers,
Franco
Comment 15 roylaprattep 2024-05-28 05:07:21 UTC
(In reply to Franco Fichtner from comment #14)
Ok ok. Sorry, I'm not used to FreeBSD architecture and how it actually works. I'm only using OPNsense, otherwise I'm a Debian guy.