diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libcharon/plugins/stroke/stroke_config.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libcharon/plugins/stroke/stroke_config.c b/src/libcharon/plugins/stroke/stroke_config.c index 64af5bb9c..da8d35c40 100644 --- a/src/libcharon/plugins/stroke/stroke_config.c +++ b/src/libcharon/plugins/stroke/stroke_config.c @@ -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'; |