summaryrefslogtreecommitdiffstats
path: root/usr.sbin/rtadvd
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2009-02-19 16:30:11 +0000
committerimp <imp@FreeBSD.org>2009-02-19 16:30:11 +0000
commit8391d4689d743c8325aa2bccaade4fc2201588f1 (patch)
treefbd7ce97e17ddc76a4fbf3803378b4c457ed2def /usr.sbin/rtadvd
parent6d22c34c992683d2b672fb60cddecb360fc2dbb6 (diff)
downloadFreeBSD-src-8391d4689d743c8325aa2bccaade4fc2201588f1.zip
FreeBSD-src-8391d4689d743c8325aa2bccaade4fc2201588f1.tar.gz
Properly convert bit value to a bit field. Before we were storing
values like 0x80 or 0x40 into a uint8_t foo:1 bitfield. This would result in the bit always being 0. One of these caused a warning for overflow (one that was 0x80), but the other didn't. They were both wrong. This is why I hate code that mixes c struct bitfields and #defines. The rest of the fields accessed by the program should be audited.
Diffstat (limited to 'usr.sbin/rtadvd')
-rw-r--r--usr.sbin/rtadvd/rrenum.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/rtadvd/rrenum.c b/usr.sbin/rtadvd/rrenum.c
index 14a8ab9..aafa0f9 100644
--- a/usr.sbin/rtadvd/rrenum.c
+++ b/usr.sbin/rtadvd/rrenum.c
@@ -176,9 +176,9 @@ do_use_prefix(int len, struct rr_pco_match *rpm,
irr->irr_u_uselen = rpu->rpu_uselen;
irr->irr_u_keeplen = rpu->rpu_keeplen;
irr->irr_raf_mask_onlink =
- (rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK);
+ !!(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_ONLINK);
irr->irr_raf_mask_auto =
- (rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_AUTO);
+ !!(rpu->rpu_ramask & ICMP6_RR_PCOUSE_RAFLAGS_AUTO);
irr->irr_vltime = ntohl(rpu->rpu_vltime);
irr->irr_pltime = ntohl(rpu->rpu_pltime);
irr->irr_raf_onlink =
OpenPOWER on IntegriCloud