summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/iptables.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/syscalls/linux/iptables.cc')
-rw-r--r--test/syscalls/linux/iptables.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/syscalls/linux/iptables.cc b/test/syscalls/linux/iptables.cc
index 7ee10bbde..22550b800 100644
--- a/test/syscalls/linux/iptables.cc
+++ b/test/syscalls/linux/iptables.cc
@@ -124,12 +124,12 @@ TEST(IPTablesBasic, GetRevision) {
ASSERT_THAT(sock = socket(AF_INET, SOCK_RAW, IPPROTO_ICMP),
SyscallSucceeds());
- struct xt_get_revision rev = {
- .name = "REDIRECT",
- .revision = 0,
- };
+ struct xt_get_revision rev = {};
socklen_t rev_len = sizeof(rev);
+ snprintf(rev.name, sizeof(rev.name), "REDIRECT");
+ rev.revision = 0;
+
// Revision 0 exists.
EXPECT_THAT(
getsockopt(sock, SOL_IP, IPT_SO_GET_REVISION_TARGET, &rev, &rev_len),