{
interface_defn *currif = NULL;
interfaces_file *defn;
+#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
mapping_defn *currmap = NULL;
+#endif
FILE *f;
char firstword[80];
char *buf = NULL;
}
if (strcmp(firstword, "mapping") == 0) {
+#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
currmap = xmalloc(sizeof(mapping_defn));
currmap->max_matches = 0;
currmap->n_matches = 0;
*where = currmap;
currmap->next = NULL;
}
+#endif
currently_processing = MAPPING;
} else if (strcmp(firstword, "iface") == 0) {
{
currif->n_options++;
break;
case MAPPING:
+#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
if (strcmp(firstword, "script") == 0) {
if (currmap->script != NULL) {
error_msg("%s:%d: duplicate script in mapping", filename, line);
error_msg("%s:%d: misplaced option", filename, line);
return NULL;
}
+#endif
break;
case NONE:
default:
return (1);
}
+#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
static int popen2(FILE **in, FILE **out, char *command, ...)
{
va_list ap;
return 1;
}
-
+#endif /* CONFIG_FEATURE_IFUPDOWN_IPV6 */
static int lookfor_iface(char **ifaces, int n_ifaces, char *iface)
{
cmds = iface_down;
}
+#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
while ((i = getopt(argc, argv, "i:hvnamf")) != -1) {
+#else
+ while ((i = getopt(argc, argv, "i:hvnaf")) != -1) {
+#endif
switch (i) {
case 'i': /* interfaces */
interfaces = xstrdup(optarg);
case 'n': /* no-act */
no_act = 1;
break;
+#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
case 'm': /* no-mappings */
run_mappings = 0;
break;
+#endif
case 'f': /* force */
force = 1;
break;
if (state_fp != NULL) {
char buf[80];
char *p;
-
+#if 0
if (!no_act) {
int flags;
struct flock lock;
perror_msg_and_die("failed to lock statefile %s", statefile);
}
}
-
+#endif
rewind(state_fp);
while ((p = fgets(buf, sizeof buf, state_fp)) != NULL) {
char *pch;
liface[79] = 0;
}
}
+#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
if ((cmds == iface_up) && run_mappings) {
mapping_defn *currmap;
}
}
}
+#endif
for (currif = defn->ifaces; currif; currif = currif->next) {
if (strcmp(liface, currif->iface) == 0) {
error_msg("Configuring interface %s=%s (%s)", iface, liface, currif->address_family->name);
}
- switch (cmds(currif)) {
- case -1:
+ if (cmds(currif) == -1) {
printf
("Don't seem to be have all the variables for %s/%s.\n",
liface, currif->address_family->name);
- break;
- case 0:
- /* this wasn't entirely successful, should it be added to
- * the state file?
- */
- case 1:
- /* successful */
}
+
currif->iface = oldiface;
}
}