Bug 284459 - if_ovpn: Undefined symbol "in6_sin6_2_sin_in_sock" if IPv6 support is disabled
Summary: if_ovpn: Undefined symbol "in6_sin6_2_sin_in_sock" if IPv6 support is disabled
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.1-RELEASE
Hardware: Any Any
: --- Affects Many People
Assignee: Kristof Provost
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-01-30 09:32 UTC by kwf
Modified: 2025-02-14 20:30 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kwf 2025-01-30 09:32:28 UTC
A kernel compiled without IPv6 support does cannot load if_ovpn.ko as it requires does not cater of IPv6 mapped addresses  from IPv4.

Specifically, these lines are not defined for only INET6 support, which causes the error. 

if (peer->local.ss_family == AF_INET6 &&
	    IN6_IS_ADDR_V4MAPPED(&TO_IN6(&peer->remote)->sin6_addr)) {
		/* V4 mapped address, so treat this as v4, not v6. */
		in6_sin6_2_sin_in_sock((struct sockaddr *)&peer->local);
		in6_sin6_2_sin_in_sock((struct sockaddr *)&peer->remote);
	}

My suggestion is to move the #ifdef INET6 before this logic.

Note: This issue is also present on the main branch.
Comment 1 commit-hook freebsd_committer freebsd_triage 2025-01-30 12:43:21 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=a55197c3228cd015ebc8218afbc938ef09191a98

commit a55197c3228cd015ebc8218afbc938ef09191a98
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-01-30 11:06:19 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-01-30 11:07:15 +0000

    if_ovpn: fix module load in NOINET6 kernels

    PR:             284459
    MFC after:      2 weeks
    Sponsored by:   Rubicon Communications, LLC ("Netgate")

 sys/net/if_ovpn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-02-13 08:46:03 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=523548736f46bfcb307846e12dc9a890fa02f327

commit 523548736f46bfcb307846e12dc9a890fa02f327
Author:     Kristof Provost <kp@FreeBSD.org>
AuthorDate: 2025-01-30 11:06:19 +0000
Commit:     Kristof Provost <kp@FreeBSD.org>
CommitDate: 2025-02-13 08:44:58 +0000

    if_ovpn: fix module load in NOINET6 kernels

    PR:             284459
    MFC after:      2 weeks
    Sponsored by:   Rubicon Communications, LLC ("Netgate")

 sys/net/if_ovpn.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)