Remove mapping option, its should always be used
This commit is contained in:
parent
fd73b8c2ce
commit
29d801b834
@ -21,7 +21,6 @@ if [ "$CONFIG_IFUPDOWN" = "y" ]; then
|
|||||||
bool ' Enable support for IPv4' CONFIG_FEATURE_IFUPDOWN_IPV4
|
bool ' Enable support for IPv4' CONFIG_FEATURE_IFUPDOWN_IPV4
|
||||||
bool ' Enable support for IPv6 (requires ip command)' CONFIG_FEATURE_IFUPDOWN_IPV6
|
bool ' Enable support for IPv6 (requires ip command)' CONFIG_FEATURE_IFUPDOWN_IPV6
|
||||||
bool ' Enable support for IPX (requires ipx_interface command)' CONFIG_FEATURE_IFUPDOWN_IPX
|
bool ' Enable support for IPX (requires ipx_interface command)' CONFIG_FEATURE_IFUPDOWN_IPX
|
||||||
bool ' Mapping support' CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
fi
|
fi
|
||||||
bool 'ip' CONFIG_IP
|
bool 'ip' CONFIG_IP
|
||||||
if [ "$CONFIG_IP" = "y" ]; then
|
if [ "$CONFIG_IP" = "y" ]; then
|
||||||
|
@ -58,7 +58,6 @@ typedef struct address_family {
|
|||||||
method *method;
|
method *method;
|
||||||
} address_family;
|
} address_family;
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
typedef struct mapping_defn {
|
typedef struct mapping_defn {
|
||||||
struct mapping_defn *next;
|
struct mapping_defn *next;
|
||||||
|
|
||||||
@ -72,7 +71,6 @@ typedef struct mapping_defn {
|
|||||||
int n_mappings;
|
int n_mappings;
|
||||||
char **mapping;
|
char **mapping;
|
||||||
} mapping_defn;
|
} mapping_defn;
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef struct variable {
|
typedef struct variable {
|
||||||
char *name;
|
char *name;
|
||||||
@ -99,9 +97,7 @@ typedef struct interfaces_file {
|
|||||||
char **autointerfaces;
|
char **autointerfaces;
|
||||||
|
|
||||||
interface_defn *ifaces;
|
interface_defn *ifaces;
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
mapping_defn *mappings;
|
mapping_defn *mappings;
|
||||||
#endif
|
|
||||||
} interfaces_file;
|
} interfaces_file;
|
||||||
|
|
||||||
#define MAX_OPT_DEPTH 10
|
#define MAX_OPT_DEPTH 10
|
||||||
@ -684,9 +680,7 @@ static interfaces_file *read_interfaces(char *filename)
|
|||||||
{
|
{
|
||||||
interface_defn *currif = NULL;
|
interface_defn *currif = NULL;
|
||||||
interfaces_file *defn;
|
interfaces_file *defn;
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
mapping_defn *currmap = NULL;
|
mapping_defn *currmap = NULL;
|
||||||
#endif
|
|
||||||
FILE *f;
|
FILE *f;
|
||||||
char firstword[80];
|
char firstword[80];
|
||||||
char *buf = NULL;
|
char *buf = NULL;
|
||||||
@ -699,9 +693,7 @@ static interfaces_file *read_interfaces(char *filename)
|
|||||||
defn = xmalloc(sizeof(interfaces_file));
|
defn = xmalloc(sizeof(interfaces_file));
|
||||||
defn->max_autointerfaces = defn->n_autointerfaces = 0;
|
defn->max_autointerfaces = defn->n_autointerfaces = 0;
|
||||||
defn->autointerfaces = NULL;
|
defn->autointerfaces = NULL;
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
defn->mappings = NULL;
|
defn->mappings = NULL;
|
||||||
#endif
|
|
||||||
defn->ifaces = NULL;
|
defn->ifaces = NULL;
|
||||||
f = fopen(filename, "r");
|
f = fopen(filename, "r");
|
||||||
if (f == NULL) {
|
if (f == NULL) {
|
||||||
@ -716,7 +708,6 @@ static interfaces_file *read_interfaces(char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strcmp(firstword, "mapping") == 0) {
|
if (strcmp(firstword, "mapping") == 0) {
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
currmap = xmalloc(sizeof(mapping_defn));
|
currmap = xmalloc(sizeof(mapping_defn));
|
||||||
currmap->max_matches = 0;
|
currmap->max_matches = 0;
|
||||||
currmap->n_matches = 0;
|
currmap->n_matches = 0;
|
||||||
@ -743,7 +734,6 @@ static interfaces_file *read_interfaces(char *filename)
|
|||||||
currmap->next = NULL;
|
currmap->next = NULL;
|
||||||
}
|
}
|
||||||
currently_processing = MAPPING;
|
currently_processing = MAPPING;
|
||||||
#endif
|
|
||||||
} else if (strcmp(firstword, "iface") == 0) {
|
} else if (strcmp(firstword, "iface") == 0) {
|
||||||
{
|
{
|
||||||
char iface_name[80];
|
char iface_name[80];
|
||||||
@ -881,7 +871,6 @@ static interfaces_file *read_interfaces(char *filename)
|
|||||||
currif->n_options++;
|
currif->n_options++;
|
||||||
break;
|
break;
|
||||||
case MAPPING:
|
case MAPPING:
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
if (strcmp(firstword, "script") == 0) {
|
if (strcmp(firstword, "script") == 0) {
|
||||||
if (currmap->script != NULL) {
|
if (currmap->script != NULL) {
|
||||||
error_msg("%s:%d: duplicate script in mapping", filename, line);
|
error_msg("%s:%d: duplicate script in mapping", filename, line);
|
||||||
@ -900,7 +889,6 @@ static interfaces_file *read_interfaces(char *filename)
|
|||||||
error_msg("%s:%d: misplaced option", filename, line);
|
error_msg("%s:%d: misplaced option", filename, line);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
break;
|
break;
|
||||||
case NONE:
|
case NONE:
|
||||||
default:
|
default:
|
||||||
@ -1076,7 +1064,6 @@ static int iface_down(interface_defn *iface)
|
|||||||
return (1);
|
return (1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
static int popen2(FILE **in, FILE **out, char *command, ...)
|
static int popen2(FILE **in, FILE **out, char *command, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
@ -1158,7 +1145,6 @@ static int run_mapping(char *physical, char *logical, int len, mapping_defn * ma
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#endif /* CONFIG_FEATURE_IFUPDOWN_MAPPING */
|
|
||||||
|
|
||||||
|
|
||||||
static int lookfor_iface(char **ifaces, int n_ifaces, char *iface)
|
static int lookfor_iface(char **ifaces, int n_ifaces, char *iface)
|
||||||
@ -1197,9 +1183,7 @@ extern int ifupdown_main(int argc, char **argv)
|
|||||||
char *statefile = "/etc/network/ifstate";
|
char *statefile = "/etc/network/ifstate";
|
||||||
|
|
||||||
int do_all = 0;
|
int do_all = 0;
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
int run_mappings = 1;
|
int run_mappings = 1;
|
||||||
#endif
|
|
||||||
int force = 0;
|
int force = 0;
|
||||||
int n_target_ifaces = 0;
|
int n_target_ifaces = 0;
|
||||||
int n_state = 0;
|
int n_state = 0;
|
||||||
@ -1228,11 +1212,9 @@ extern int ifupdown_main(int argc, char **argv)
|
|||||||
case 'n': /* no-act */
|
case 'n': /* no-act */
|
||||||
no_act = 1;
|
no_act = 1;
|
||||||
break;
|
break;
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
case 'm': /* no-mappings */
|
case 'm': /* no-mappings */
|
||||||
run_mappings = 0;
|
run_mappings = 0;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
case 'f': /* force */
|
case 'f': /* force */
|
||||||
force = 1;
|
force = 1;
|
||||||
break;
|
break;
|
||||||
@ -1356,7 +1338,6 @@ extern int ifupdown_main(int argc, char **argv)
|
|||||||
liface[79] = 0;
|
liface[79] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
|
|
||||||
if ((cmds == iface_up) && run_mappings) {
|
if ((cmds == iface_up) && run_mappings) {
|
||||||
mapping_defn *currmap;
|
mapping_defn *currmap;
|
||||||
|
|
||||||
@ -1373,7 +1354,6 @@ extern int ifupdown_main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for (currif = defn->ifaces; currif; currif = currif->next) {
|
for (currif = defn->ifaces; currif; currif = currif->next) {
|
||||||
if (strcmp(liface, currif->iface) == 0) {
|
if (strcmp(liface, currif->iface) == 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user