aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--networking/ifupdown.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index 9fc1266da..650cc706f 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -49,9 +49,6 @@
49#include <fnmatch.h> 49#include <fnmatch.h>
50 50
51#define MAX_OPT_DEPTH 10 51#define MAX_OPT_DEPTH 10
52#define EUNBALBRACK 10001
53#define EUNDEFVAR 10002
54#define EUNBALPER 10000
55 52
56#if ENABLE_FEATURE_IFUPDOWN_MAPPING 53#if ENABLE_FEATURE_IFUPDOWN_MAPPING
57#define MAX_INTERFACE_LENGTH 10 54#define MAX_INTERFACE_LENGTH 10
@@ -283,7 +280,7 @@ static char *parse(const char *command, struct interface_defn_t *ifd)
283 command++; 280 command++;
284 nextpercent = strchr(command, '%'); 281 nextpercent = strchr(command, '%');
285 if (!nextpercent) { 282 if (!nextpercent) {
286 errno = EUNBALPER; 283 /* Unterminated %var% */
287 free(result); 284 free(result);
288 return NULL; 285 return NULL;
289 } 286 }
@@ -328,13 +325,13 @@ static char *parse(const char *command, struct interface_defn_t *ifd)
328 } 325 }
329 326
330 if (opt_depth > 1) { 327 if (opt_depth > 1) {
331 errno = EUNBALBRACK; 328 /* Unbalanced bracket */
332 free(result); 329 free(result);
333 return NULL; 330 return NULL;
334 } 331 }
335 332
336 if (!okay[0]) { 333 if (!okay[0]) {
337 errno = EUNDEFVAR; 334 /* Undefined variable and we aren't in a bracket */
338 free(result); 335 free(result);
339 return NULL; 336 return NULL;
340 } 337 }