From 6aada3117b6a655be602e78fffad0b770cf5165f Mon Sep 17 00:00:00 2001 From: Luigi Rizzo Date: Thu, 4 Mar 2010 16:52:26 +0000 Subject: [PATCH] improve compatibility with RELENG_7.2 --- sys/netinet/ipfw/ip_fw_sockopt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/netinet/ipfw/ip_fw_sockopt.c b/sys/netinet/ipfw/ip_fw_sockopt.c index f61c12632fff..9d67dc008695 100644 --- a/sys/netinet/ipfw/ip_fw_sockopt.c +++ b/sys/netinet/ipfw/ip_fw_sockopt.c @@ -1212,6 +1212,13 @@ convert_rule_to_7(struct ip_fw *rule) ccmdlen = F_LEN(ccmd); bcopy(ccmd, dst, F_LEN(ccmd)*sizeof(uint32_t)); + + if (dst->opcode > O_NAT) + /* O_REASS doesn't exists in 7.2 version, so + * decrement opcode if it is after O_REASS + */ + dst->opcode--; + if (ccmdlen > ll) { printf("ipfw: opcode %d size truncated\n", ccmd->opcode); @@ -1246,6 +1253,13 @@ convert_rule_to_8(struct ip_fw *rule) ccmdlen = F_LEN(ccmd); bcopy(ccmd, dst, F_LEN(ccmd)*sizeof(uint32_t)); + + if (dst->opcode > O_NAT) + /* O_REASS doesn't exists in 7.2 version, so + * increment opcode if it is after O_REASS + */ + dst->opcode++; + if (ccmdlen > ll) { printf("ipfw: opcode %d size truncated\n", ccmd->opcode);