Skip to content

Commit

Permalink
Eucanetd vpcmido map tcp/udp zero port security group and network acl…
Browse files Browse the repository at this point in the history
… rules
  • Loading branch information
sjones4 committed Dec 19, 2019
1 parent e7dfa3f commit 2924976
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions net/euca-to-mido.c
Original file line number Diff line number Diff line change
Expand Up @@ -4722,9 +4722,12 @@ int parse_mido_chain_rule_protocol(int proto, int icmpType, int icmpCode,
break;
case 6: // TCP
case 17: // UDP
if ((fromPort == 0) && (toPort == 0)) {
LOGDEBUG("Invalid argument: mapping tcp/udp rule with zero port\n");
}
snprintf(parsed_rule->jsonel[MIDO_CRULE_TPD], 64, "jsonjson");
snprintf(parsed_rule->jsonel[MIDO_CRULE_TPD_S], 64, "%d", fromPort);
snprintf(parsed_rule->jsonel[MIDO_CRULE_TPD_E], 64, "%d", toPort);
snprintf(parsed_rule->jsonel[MIDO_CRULE_TPD_S], 64, "%d", (fromPort == 0) ? 1 : fromPort);
snprintf(parsed_rule->jsonel[MIDO_CRULE_TPD_E], 64, "%d", (toPort == 0) ? 1 : toPort);
snprintf(parsed_rule->jsonel[MIDO_CRULE_TPD_END], 64, "END");
break;
case -1: // All protocols
Expand Down

0 comments on commit 2924976

Please sign in to comment.