Bug 294114 - ipfw: nptv6 (with ext_if) fails to react on address removal
Summary: ipfw: nptv6 (with ext_if) fails to react on address removal
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 14.4-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: freebsd-ipfw (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-03-29 09:26 UTC by Peter Much
Modified: 2026-04-09 08:38 UTC (History)
1 user (show)

See Also:


Attachments
fix for the wrong comparison (646 bytes, patch)
2026-03-29 09:29 UTC, Peter Much
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Much 2026-03-29 09:26:32 UTC
To reproduce:
1. sentinel-interface has the current address/prefix, and nptv6 is correctly translating.
2. now the prefix gets changed, and we configure the interface in two steps:

   # ifconfig vtnet0 inet6 <new-address>
   # ifconfig vtnet0 inet6 <old-address> -alias

Result: nptv6 does still translate to the old address, and dtrace did not show an invocation of nptv6_find_prefix().

Analysis/Fix: a comparison in ifaddr_cb() is strictly wrong.

Reference:
https://forums.freebsd.org/threads/my-site-went-offline-what-is-the-result-of-1-1.102168/
Comment 1 Peter Much 2026-03-29 09:29:53 UTC
Created attachment 269201 [details]
fix for the wrong comparison
Comment 2 commit-hook freebsd_committer freebsd_triage 2026-04-02 10:25:14 UTC
A commit in branch main references this bug:

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

commit d9d7b59486499615a5fdce54443ce62aecf557e8
Author:     Andrey V. Elsukov <ae@FreeBSD.org>
AuthorDate: 2026-04-02 10:14:29 +0000
Commit:     Andrey V. Elsukov <ae@FreeBSD.org>
CommitDate: 2026-04-02 10:14:29 +0000

    ipfw_nptv6: fix handling the ifaddr removal event

    The result of IN6_ARE_MASKED_ADDR_EQUAL() macro is not an integer, so
    threat it as a boolean value.

    PR:             294114
    Reported by:    Peter Much <pmc citylink dinoex sub org>
    MFC after:      1 week

 sys/netpfil/ipfw/nptv6/nptv6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2026-04-09 08:36:50 UTC
A commit in branch stable/15 references this bug:

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

commit bdad7024181b1ee14555ff334235b8d52e0ab15c
Author:     Andrey V. Elsukov <ae@FreeBSD.org>
AuthorDate: 2026-04-02 10:14:29 +0000
Commit:     Andrey V. Elsukov <ae@FreeBSD.org>
CommitDate: 2026-04-09 08:34:42 +0000

    ipfw_nptv6: fix handling the ifaddr removal event

    The result of IN6_ARE_MASKED_ADDR_EQUAL() macro is not an integer, so
    threat it as a boolean value.

    PR:             294114
    Reported by:    Peter Much <pmc citylink dinoex sub org>

    (cherry picked from commit d9d7b59486499615a5fdce54443ce62aecf557e8)

 sys/netpfil/ipfw/nptv6/nptv6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-04-09 08:37:52 UTC
A commit in branch stable/14 references this bug:

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

commit 4b6de64b99b984bee2f9f16f00364ba7f52a5dc1
Author:     Andrey V. Elsukov <ae@FreeBSD.org>
AuthorDate: 2026-04-02 10:14:29 +0000
Commit:     Andrey V. Elsukov <ae@FreeBSD.org>
CommitDate: 2026-04-09 08:36:13 +0000

    ipfw_nptv6: fix handling the ifaddr removal event

    The result of IN6_ARE_MASKED_ADDR_EQUAL() macro is not an integer, so
    threat it as a boolean value.

    PR:             294114
    Reported by:    Peter Much <pmc citylink dinoex sub org>

    (cherry picked from commit d9d7b59486499615a5fdce54443ce62aecf557e8)

 sys/netpfil/ipfw/nptv6/nptv6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 5 Andrey V. Elsukov freebsd_committer freebsd_triage 2026-04-09 08:38:52 UTC
Fixed in main and stable/[14,15] branches. Thanks!