stroke: Changed how proto/port are specified in left|rightsubnet

Using a colon as separator conflicts with IPv6 addresses.
This commit is contained in:
Tobias Brunner
2013-06-28 15:10:09 +02:00
parent b18a531715
commit b7b5432ff8
2 changed files with 15 additions and 7 deletions
+8 -1
View File
@@ -895,6 +895,13 @@ static bool parse_protoport(char *token, u_int16_t *from_port,
struct servent *svc;
long int p;
sep = strrchr(token, ']');
if (!sep)
{
return FALSE;
}
*sep = '\0';
sep = strchr(token, '/');
if (sep)
{ /* protocol/port */
@@ -1009,7 +1016,7 @@ static void add_ts(private_stroke_config_t *this,
to_port = end->to_port;
proto = end->protocol;
pos = strchr(subnet, ':');
pos = strchr(subnet, '[');
if (pos)
{
*(pos++) = '\0';