starter: Fixed parsing of %defaultroute.
authorTobias Brunner <tobias@strongswan.org>
Fri, 15 Jun 2012 08:32:15 +0000 (10:32 +0200)
committerTobias Brunner <tobias@strongswan.org>
Fri, 15 Jun 2012 08:46:56 +0000 (10:46 +0200)
src/starter/confread.c

index cee9e9d..671cfba 100644 (file)
@@ -214,12 +214,18 @@ static void kw_end(starter_conn_t *conn, starter_end_t *end, kw_token_t token,
        switch (token)
        {
        case KW_HOST:
-               if (value && strlen(value) > 0 && value[0] == '%' &&
-                       !streq(value, "%any") && !streq(value, "%any4") &&
-                       !streq(value, "%any6"))
-               {       /* allow_any prefix */
-                       end->allow_any = TRUE;
-                       value++;
+               if (value && strlen(value) > 0 && value[0] == '%')
+               {
+                       if (streq(value, "%defaultroute"))
+                       {
+                               value = "%any";
+                       }
+                       if (!streq(value, "%any") && !streq(value, "%any4") &&
+                               !streq(value, "%any6"))
+                       {       /* allow_any prefix */
+                               end->allow_any = TRUE;
+                               value++;
+                       }
                }
                free(end->host);
                end->host = strdupnull(value);