Skip to content

net/upnp: Complete service improvements 2/2#5256

Merged
fichtner merged 3 commits intoopnsense:masterfrom
Self-Hosting-Group:not-applied
Mar 4, 2026
Merged

net/upnp: Complete service improvements 2/2#5256
fichtner merged 3 commits intoopnsense:masterfrom
Self-Hosting-Group:not-applied

Conversation

@Self-Hosting-Group
Copy link
Copy Markdown
Contributor

@Self-Hosting-Group Self-Hosting-Group commented Feb 25, 2026

  • More specific allow third-party mapping UI option
  • Remove unnecessary binat anchor registration
  • Update missed changelog

Follow-up to #5126

Comment thread net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc Outdated
}

if (!empty($upnp_config['allow_third_party_mapping'])) {
if (($upnp_config['allow_third_party_mapping'] ?? '') == '1' || ($upnp_config['allow_third_party_mapping'] ?? '') == 'upnp-igd') {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feels like this overcomplicates things and imposes "upnp-igd" on the meaning when in reality we're flipping pcp with this and the secure mode simply is handled as a separate toggle?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may look overcomplicated to you, but that's only because the daemon initially had the meaningless option name secure_mode for UPnP IGD, PCP support was added later. secure_mode only applies to UPnP IGD, whereas pcp_allow_thirdparty (reversed) only applies to PCP. The same option is also available in OpenWrt, and I cannot imagine why anyone would make two options out of it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair, still don't like the handling of this with four times ?? '' and two times checking the same flag. something that an in_array() can do much more concisely.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still pending

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@Self-Hosting-Group Self-Hosting-Group force-pushed the not-applied branch 4 times, most recently from 7216aa4 to b0852db Compare February 27, 2026 15:49
@Self-Hosting-Group Self-Hosting-Group changed the title net/upnp: Not applied in #5126 net/upnp: Complete service improvements 2/2 Feb 27, 2026
- More specific allow third-party mapping UI option
- Remove unnecessary `binat` anchor registration
- Fix debug logging not treating `-v -v` (follow-up to 7658677)
- Update missed changelog

Follow-up to opnsense#5126
Comment thread net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc Outdated
default:
break;
case 'debug':
$cmd_frmt[] = '-vv';
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need evidence -v -v works differently than -vv

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message explains why that is needed for the special behaving daemon: Fix debug logging not treating -v -v (follow-up to 7658677)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The miniupnpd code suggests it doesn't care if it's -vv or -v -v which is why I raised the question after you said it's wrong. I just want a dependable answer.

https://github.com/miniupnp/miniupnp/blob/f33ae48402835b5b93029b1861a32630f9f17d1b/miniupnpd/miniupnpd.c#L1609-L1615

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

@fichtner fichtner Mar 4, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both -v -v and -vv trigger verbosity_level++; twice if I read this correctly. I just want to know what mistake I made so I can avoid it in the future.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I made a mistake. When I first tested it, it didn't seem to work, but I just tested it again and now it works. Sorry!

Comment thread net/upnp/pkg-descr Outdated
Self-Hosting-Group added a commit to Self-Hosting-Group/plugins that referenced this pull request Mar 3, 2026
- More specific allow third-party mapping UI option
- Remove unnecessary `binat` anchor registration
- Fix debug logging not treating `-v -v` (follow-up to 7658677)
- Update missed changelog

Follow-up to opnsense#5126
@Self-Hosting-Group
Copy link
Copy Markdown
Contributor Author

I don't know if you want a changelog or to what extent. The list of new/removed UI options can be dropped, or the changelog reduced to just one line, as you prefer.

Comment thread net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc
@fichtner
Copy link
Copy Markdown
Member

fichtner commented Mar 3, 2026

I don't know if you want a changelog or to what extent. The list of new/removed UI options can be dropped, or the changelog reduced to just one line, as you prefer.

Changelog seems good, thanks!

@Self-Hosting-Group Self-Hosting-Group marked this pull request as ready for review March 4, 2026 08:00
@Self-Hosting-Group
Copy link
Copy Markdown
Contributor Author

@fichtner Both PRs ready.

@fichtner fichtner self-assigned this Mar 4, 2026
Comment thread net/upnp/pkg-descr Outdated
Comment thread net/upnp/src/etc/inc/plugins.inc.d/miniupnpd.inc Outdated
@fichtner fichtner merged commit 6c81f6d into opnsense:master Mar 4, 2026
@fichtner
Copy link
Copy Markdown
Member

fichtner commented Mar 4, 2026

Merged, thanks!

@Self-Hosting-Group
Copy link
Copy Markdown
Contributor Author

Thank you. I am happy that you have removed the length limit of the new entries in the changelog; it looks more compact.

@Self-Hosting-Group
Copy link
Copy Markdown
Contributor Author

It's not all contributed by…, also you improved my limited PHP experience. Thank you!

@fichtner
Copy link
Copy Markdown
Member

fichtner commented Mar 4, 2026

It's not all contributed by…, also you improved my limited PHP experience. Thank you!

we don't assert credits for helping with contributions since it's day to day work anyway

@fichtner
Copy link
Copy Markdown
Member

fichtner commented Mar 4, 2026

FWIW, I'm pushing the plugin changes into today's 26.1.3. Need to look and discuss the ports PR at a later point in time.

@Self-Hosting-Group
Copy link
Copy Markdown
Contributor Author

FWIW: In order to keep the maintenance effort for the added tested patches to a minimum in the future, I have suggested them to the daemon project and just updated the FreeBSD ports PR. PS: There is already a note about this in the changelog.

@Self-Hosting-Group
Copy link
Copy Markdown
Contributor Author

@fichtner
Copy link
Copy Markdown
Member

fichtner commented Mar 4, 2026

If you want my professional opinion work directly upstream and forget FreeBSD. Your PR nears the 1 year mark. Nobody is willing to invest time to help out contributors. One of the reasons why we do things differently in OPNsense.

@Self-Hosting-Group
Copy link
Copy Markdown
Contributor Author

Exactly, that was my plan! ;-) I never wanted to add the same patches multiple times downstream (for multiple router OSs). However, little is happening upstream. Therefore, I attempted to resolve the daemon logging issues for OPNsense customers (I'm not a user), in this manner, as I feel like I have no other choice. See daemon activity: https://github.com/miniupnp

@fichtner
Copy link
Copy Markdown
Member

fichtner commented Mar 4, 2026

Well, we can add some legitimacy for your patches from here, but ultimately a small fork to point to for patches would be preferable to keep the repo noise down in the ports tree. I did something similar with ports-mgmt/pkg, see opnsense/ports@bbd09e7 so we have https://github.com/opnsense/pkg to hold modifications (which are also easier visible and reviewable)

@Self-Hosting-Group
Copy link
Copy Markdown
Contributor Author

Good idea! I'll come back to it soon.

leandroscardua pushed a commit to leandroscardua/plugins that referenced this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants