svn commit: r341057 - in stable/11: sbin/ipfw sys/netinet
Andrey V. Elsukov
ae at FreeBSD.org
Tue Nov 27 14:03:41 UTC 2018
Author: ae
Date: Tue Nov 27 14:03:40 2018
New Revision: 341057
URL: https://svnweb.freebsd.org/changeset/base/341057
Log:
MFC r340689:
Make multiline APPLY_MASK() macro to be function-like.
Reported by: cem
Modified:
stable/11/sbin/ipfw/ipv6.c
stable/11/sys/netinet/ip_fw.h
Directory Properties:
stable/11/ (props changed)
Modified: stable/11/sbin/ipfw/ipv6.c
==============================================================================
--- stable/11/sbin/ipfw/ipv6.c Tue Nov 27 14:01:59 2018 (r341056)
+++ stable/11/sbin/ipfw/ipv6.c Tue Nov 27 14:03:40 2018 (r341057)
@@ -401,7 +401,7 @@ fill_ip6(ipfw_insn_ip6 *cmd, char *av, int cblen, stru
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;
Modified: stable/11/sys/netinet/ip_fw.h
==============================================================================
--- stable/11/sys/netinet/ip_fw.h Tue Nov 27 14:01:59 2018 (r341056)
+++ stable/11/sys/netinet/ip_fw.h Tue Nov 27 14:03:40 2018 (r341057)
@@ -549,11 +549,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 {
More information about the svn-src-all
mailing list