Complain about missing %defaultroute support only if one is actually used
authorMartin Willi <martin@strongswan.org>
Wed, 16 Sep 2009 11:27:49 +0000 (13:27 +0200)
committerMartin Willi <martin@strongswan.org>
Wed, 16 Sep 2009 11:27:49 +0000 (13:27 +0200)
src/starter/confread.c
src/starter/interfaces.c
src/starter/interfaces.h

index ef27ce8..c4b8916 100644 (file)
@@ -245,6 +245,10 @@ kw_end(starter_conn_t *conn, starter_end_t *end, kw_token_t token
                                end->addr    = cfg->defaultroute.addr;
                                end->nexthop = cfg->defaultroute.nexthop;
                        }
+                       else if (!cfg->defaultroute.supported)
+                       {
+                               plog("%%defaultroute not supported, fallback to %%any");
+                       }
                        else
                        {
                                plog("# default route not known: %s=%s", name, value);
index 08bd97a..ba16a39 100644 (file)
@@ -173,6 +173,7 @@ get_defaultroute(defaultroute_t *defaultroute)
                        defaultroute->defined = TRUE;
                }
        }
+       defaultroute->supported = TRUE;
 
        if (!defaultroute->defined)
                plog("no default route - cannot cope with %%defaultroute!!!");
@@ -186,9 +187,7 @@ get_defaultroute(defaultroute_t *defaultroute)
 void
 get_defaultroute(defaultroute_t *defaultroute)
 {
-       memset(defaultroute, 0, sizeof(defaultroute_t));
-       defaultroute->defined = TRUE;
-       plog("%%defaultroute not supported, fallback to %%any");
+       defaultroute->supported = FALSE;
 }
 #endif /* START_PLUTO */
 
index abe4c8f..ff8535f 100644 (file)
@@ -23,6 +23,7 @@
 
 typedef struct {
        bool defined;
+       bool supported;
        char iface[IFNAMSIZ];
        ip_address addr;
        ip_address nexthop;