aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey V. Elsukov <ae@FreeBSD.org>2018-11-20 18:38:28 +0000
committerAndrey V. Elsukov <ae@FreeBSD.org>2018-11-20 18:38:28 +0000
commit5786c6b9f999bc003952dbc8d049c7e6690ef009 (patch)
tree03e3594e52da672dbf0380783e712e49488d1785
parent9ed1e4ecd4e9eb3bde16f52a937a6fa86a971638 (diff)
downloadsrc-5786c6b9f999bc003952dbc8d049c7e6690ef009.tar.gz
src-5786c6b9f999bc003952dbc8d049c7e6690ef009.zip
Make multiline APPLY_MASK() macro to be function-like.
Reported by: cem MFC after: 1 week
Notes
Notes: svn path=/head/; revision=340689
-rw-r--r--sbin/ipfw/ipv6.c2
-rw-r--r--sys/netinet/ip_fw.h5
2 files changed, 4 insertions, 3 deletions
diff --git a/sbin/ipfw/ipv6.c b/sbin/ipfw/ipv6.c
index 3bc5789fda41..7f30a1df7bcb 100644
--- a/sbin/ipfw/ipv6.c
+++ b/sbin/ipfw/ipv6.c
@@ -401,7 +401,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, struct tidx *tstate)
n2mask(&d[1], masklen);
}
- APPLY_MASK(d, &d[1]) /* mask base address with mask */
+ APPLY_MASK(d, &d[1]); /* mask base address with mask */
av = q;
diff --git a/sys/netinet/ip_fw.h b/sys/netinet/ip_fw.h
index cfcdaa296278..e49b9ad9c6c6 100644
--- a/sys/netinet/ip_fw.h
+++ b/sys/netinet/ip_fw.h
@@ -551,11 +551,12 @@ typedef struct _ipfw_insn_nat {
} ipfw_insn_nat;
/* Apply ipv6 mask on ipv6 addr */
-#define APPLY_MASK(addr,mask) \
+#define APPLY_MASK(addr,mask) do { \
(addr)->__u6_addr.__u6_addr32[0] &= (mask)->__u6_addr.__u6_addr32[0]; \
(addr)->__u6_addr.__u6_addr32[1] &= (mask)->__u6_addr.__u6_addr32[1]; \
(addr)->__u6_addr.__u6_addr32[2] &= (mask)->__u6_addr.__u6_addr32[2]; \
- (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3];
+ (addr)->__u6_addr.__u6_addr32[3] &= (mask)->__u6_addr.__u6_addr32[3]; \
+} while (0)
/* Structure for ipv6 */
typedef struct _ipfw_insn_ip6 {