git: 200de1b70e2b - main - rtadvd(8): Fix RA flag inconsistency messages

Pouria Mousavizadeh Tehrani <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a7354fa.4702b.516957b0__42694.5820030355$1785943387$gmane$org@gitrepo.freebsd.org>
The branch main has been updated by pouria:

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

commit 200de1b70e2b4f809d1d3a4c430db80b24124468
Author:     Pouria Mousavizadeh Tehrani <[email protected]>
AuthorDate: 2026-08-05 08:27:54 +0000
Commit:     Pouria Mousavizadeh Tehrani <[email protected]>
CommitDate: 2026-08-05 15:20:04 +0000

    rtadvd(8): Fix RA flag inconsistency messages
    
    During flag inconsistency report, we handle rai->rai_otherflg
    as a bool, but the value is 0x40. Make it a simple number comparison.
    
    PR:             295995
    Reviewed by:    markj, Faraz Vahedi <[email protected]>
    MFC after:      3 days
    Differential Revision: https://reviews.freebsd.org/D58672
---
 usr.sbin/rtadvd/rtadvd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/usr.sbin/rtadvd/rtadvd.c b/usr.sbin/rtadvd/rtadvd.c
index b772f78845d8..1525c992a65b 100644
--- a/usr.sbin/rtadvd/rtadvd.c
+++ b/usr.sbin/rtadvd/rtadvd.c
@@ -1138,9 +1138,9 @@ ra_input(int len, struct nd_router_advert *nra,
 		syslog(LOG_NOTICE,
 		    "M flag inconsistent on %s:"
 		    " %s from %s, %s from us",
-		    ifi->ifi_ifname, on_off[!rai->rai_managedflg],
+		    ifi->ifi_ifname, on_off[rai->rai_managedflg == 0],
 		    inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
-			sizeof(ntopbuf)), on_off[rai->rai_managedflg]);
+			sizeof(ntopbuf)), on_off[rai->rai_managedflg != 0]);
 		inconsistent++;
 	}
 	/* O flag */
@@ -1149,9 +1149,9 @@ ra_input(int len, struct nd_router_advert *nra,
 		syslog(LOG_NOTICE,
 		    "O flag inconsistent on %s:"
 		    " %s from %s, %s from us",
-		    ifi->ifi_ifname, on_off[!rai->rai_otherflg],
+		    ifi->ifi_ifname, on_off[rai->rai_otherflg == 0],
 		    inet_ntop(AF_INET6, &from->sin6_addr, ntopbuf,
-			sizeof(ntopbuf)), on_off[rai->rai_otherflg]);
+			sizeof(ntopbuf)), on_off[rai->rai_otherflg != 0]);
 		inconsistent++;
 	}
 	/* Reachable Time */
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.