Simplify O_NAT opcode handling.

MFC after:	2 weeks
Sponsored by:	Yandex LLC
This commit is contained in:
Alexander V. Chernikov 2013-11-28 15:28:51 +00:00
parent 4506391d54
commit a19b3f74af

View File

@ -2413,9 +2413,13 @@ do { \
}
case O_NAT:
l = 0; /* exit inner loop */
done = 1; /* exit outer loop */
if (!IPFW_NAT_LOADED) {
retval = IP_FW_DENY;
} else {
break;
}
struct cfg_nat *t;
int nat_id;
@ -2423,8 +2427,6 @@ do { \
/* Check if this is 'global' nat rule */
if (cmd->arg1 == 0) {
retval = ipfw_nat_ptr(args, NULL, m);
l = 0;
done = 1;
break;
}
t = ((ipfw_insn_nat *)cmd)->nat;
@ -2434,17 +2436,12 @@ do { \
if (t == NULL) {
retval = IP_FW_DENY;
l = 0; /* exit inner loop */
done = 1; /* exit outer loop */
break;
}
if (cmd->arg1 != IP_FW_TABLEARG)
((ipfw_insn_nat *)cmd)->nat = t;
}
retval = ipfw_nat_ptr(args, t, m);
}
l = 0; /* exit inner loop */
done = 1; /* exit outer loop */
break;
case O_REASS: {