Bug 250125 - net-mgmt/net-snmp still defines IPv6 macros when IPv6 is disabled at build time.
Summary: net-mgmt/net-snmp still defines IPv6 macros when IPv6 is disabled at build time.
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Ryan Steinmetz
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-04 19:12 UTC by Ivan
Modified: 2024-01-10 06:20 UTC (History)
4 users (show)

See Also:


Attachments
poudriere build log (139.81 KB, text/plain)
2020-10-04 19:12 UTC, Ivan
no flags Details
add patch to files/ and rebuild (336 bytes, patch)
2024-01-10 06:20 UTC, Kurt Jaeger
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan 2020-10-04 19:12:37 UTC
Created attachment 218524 [details]
poudriere build log

nuts doesn't build if ipv6 support disabled in net-mgmt/net-snmp
Comment 1 Cy Schubert freebsd_committer freebsd_triage 2020-10-06 05:56:16 UTC
Can you provide the output of the following command, please?

grep NETSNMP_TRANSPORT_UDPIPV6_DOMAIN /usr/local/include/net-snmp/net-snmp-config.h
Comment 2 Ivan 2020-10-06 12:22:18 UTC
#define NETSNMP_TRANSPORT_UDPIPV6_DOMAIN 1
#ifdef NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
# define SNMP_TRANSPORT_UDPIPV6_DOMAIN NETSNMP_TRANSPORT_UDPIPV6_DOMAIN
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2020-10-06 13:40:01 UTC
I discovered this too, here, last night. net-snmp is failing to undefine NETSNMP_TRANSPORT_UDPIPV6_DOMAIN, making apps believe IPv6 is still compiled in.

I will assign this PR to zi@, the maintainer of net-snmp. He should change the title to something like "net-mgmt/net-snmp still defines IPv6 macros when IPv6 is disabled at build time."
Comment 4 Ivan 2020-10-06 14:20:59 UTC
Thanks! 
I'll enable ipv6 in net-mgmt/net-snmp for my builds then.
Comment 5 Cy Schubert freebsd_committer freebsd_triage 2020-10-06 14:30:07 UTC
For now, yes.

NETSNMP_TRANSPORT_TCPIPV6_DOMAIN is also defined as 1 when IPv6 is disabled. I suspect that zi@, after some investigation, will discover that there is much more broken in net-snmp than just this one macro definition when IPv6 is disabled and will likely need to push this upstream for ultimate resolution (without spending too much time at this).
Comment 6 Ryan Steinmetz freebsd_committer freebsd_triage 2020-10-06 15:37:55 UTC
My inclination is to just convert the existing IPV6 OPTION to not an OPTION and force it to be on.

Do either of you see a reason not to do this?
Comment 7 Ivan 2020-10-06 15:45:29 UTC
Well, I'd say I don't know such reason. I believe, ipv6 knob in kernel is deprecated or removed, so probably, it's time to clean this option from ports as well, especially if it's hard to maintain.
Comment 8 Cy Schubert freebsd_committer freebsd_triage 2020-10-06 15:51:41 UTC
Though my ISP (cable company) doesn't support it, I use IPv6 internally for ipfilter testing. I enable it for everything.

Disabling IPv6 in net-snmp may have other issues: https://sourceforge.net/p/net-snmp/bugs/2903/. If it has this problem in Linux I expect to have the same problem in FreeBSD. In this case they fixed the logging but not the cause. This suggests that there's much more broken in net-snmp when IPv6 is disabled. It probably makes sense to disable the option entirely. You might want to discuss this in a little more detail in the commit log message to make sure nobody follows up by re-enabling the no IPv6 option.
Comment 9 Cy Schubert freebsd_committer freebsd_triage 2020-10-06 17:50:29 UTC
(In reply to Ivan from comment #7)
INET6 can still be removed from your kernel config. Doing so might expose some bugs though. I don't know anyone who runs a kernel without the INET6 option enabled.
Comment 10 Ryan Steinmetz freebsd_committer freebsd_triage 2020-10-06 18:00:38 UTC
Maybe the easiest thing, for now, is to make IPV6 enabled by default.  That should fix everyone using the freebsd.org packages and make things work out of the box.  If people elect to make custom builds and run into issues, then that's probably a separate issue.

Thoughts?
Comment 11 Cy Schubert freebsd_committer freebsd_triage 2020-10-06 18:25:12 UTC
Enabled by default and remove the option entirely until the upstream can fix the multitude of problems. They're on GH at https://github.com/net-snmp/net-snmp. Maybe raise an issue. And while we're at it USE_GH=yes and maybe even a net-snmp-devel port, though that might be a little more trouble than it's worth. Feeding the bears (like in the park), as a co-worker of mine says, can have consequences for the developer or support person. But something to thing about anyway. My krb5-devel, nut-devel and cfengine-devel ports haven't resulted in any extra tickets though. I'll leave it to you to decide.

Personally, I use nut-devel since there hasn't been a release of nut for quite some time.
Comment 12 gergely.czuczy 2021-11-10 06:17:00 UTC
This bug is still there. Could we please get at least a workaround (like displaying an error if ipv6 is disabled for net-snmp) until it is fixed?
Comment 13 Kurt Jaeger freebsd_committer freebsd_triage 2024-01-10 06:20:25 UTC
Created attachment 247563 [details]
add patch to files/ and rebuild

This patch seems to fix the issue with 5.9.4, still working on a full patch to upgrade from 5.9.1.