Skip to content

Commit

Permalink
feat: config: cidr prefix length defaults to 32 or 128 when not provided
Browse files Browse the repository at this point in the history
  • Loading branch information
shunf4 committed Jun 24, 2020
1 parent eb33964 commit 1a659f2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/exe/args_and_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,17 @@ static int OptionGetIpPortValue(PXCH_IP_PORT* pIpPort, PXCH_UINT32* pdwPrefixLen

*pdwPrefixLength = (PXCH_UINT32)lPrefix;
} else {
if (bAllowCidr) {
switch (pIpPort->CommonHeader.wTag) {
case PXCH_HOST_TYPE_IPV4:
*pdwPrefixLength = 32;
break;
case PXCH_HOST_TYPE_IPV6:
*pdwPrefixLength = 128;
break;
}
}

pAfterPrefix = pAfterIpPort;
}

Expand Down

0 comments on commit 1a659f2

Please sign in to comment.