summaryrefslogtreecommitdiffstats
path: root/extensions/libct_proto_icmp.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libct_proto_icmp.c')
-rw-r--r--extensions/libct_proto_icmp.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/extensions/libct_proto_icmp.c b/extensions/libct_proto_icmp.c
index 2ce1c65..7fc82bd 100644
--- a/extensions/libct_proto_icmp.c
+++ b/extensions/libct_proto_icmp.c
@@ -78,18 +78,24 @@ static int parse(char c,
tmp = atoi(optarg);
nfct_set_attr_u8(ct, ATTR_ICMP_TYPE, tmp);
nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_ICMP);
+ if (nfct_attr_is_set(ct, ATTR_REPL_L3PROTO))
+ nfct_set_attr_u8(ct, ATTR_REPL_L4PROTO, IPPROTO_ICMP);
*flags |= CT_ICMP_TYPE;
break;
case '2':
tmp = atoi(optarg);
nfct_set_attr_u8(ct, ATTR_ICMP_CODE, tmp);
nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_ICMP);
+ if (nfct_attr_is_set(ct, ATTR_REPL_L3PROTO))
+ nfct_set_attr_u8(ct, ATTR_REPL_L4PROTO, IPPROTO_ICMP);
*flags |= CT_ICMP_CODE;
break;
case '3':
id = htons(atoi(optarg));
nfct_set_attr_u16(ct, ATTR_ICMP_ID, id);
nfct_set_attr_u8(ct, ATTR_L4PROTO, IPPROTO_ICMP);
+ if (nfct_attr_is_set(ct, ATTR_REPL_L3PROTO))
+ nfct_set_attr_u8(ct, ATTR_REPL_L4PROTO, IPPROTO_ICMP);
*flags |= CT_ICMP_ID;
break;
}