aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn L McGrath <bug1@ihug.co.nz>2002-11-17 21:48:11 +0000
committerGlenn L McGrath <bug1@ihug.co.nz>2002-11-17 21:48:11 +0000
commit29d801b834b908bde20984a5fd9a782f04da7e1a (patch)
tree6fe0d8f3f85b968c5a184e0a148669ca96eafcfd
parentfd73b8c2ce6ae9517e37127cba2a48a6ee803287 (diff)
downloadbusybox-w32-29d801b834b908bde20984a5fd9a782f04da7e1a.tar.gz
busybox-w32-29d801b834b908bde20984a5fd9a782f04da7e1a.tar.bz2
busybox-w32-29d801b834b908bde20984a5fd9a782f04da7e1a.zip
Remove mapping option, its should always be used
-rw-r--r--networking/config.in1
-rw-r--r--networking/ifupdown.c20
2 files changed, 0 insertions, 21 deletions
diff --git a/networking/config.in b/networking/config.in
index 27a8ab571..d62a6e425 100644
--- a/networking/config.in
+++ b/networking/config.in
@@ -21,7 +21,6 @@ if [ "$CONFIG_IFUPDOWN" = "y" ]; then
21 bool ' Enable support for IPv4' CONFIG_FEATURE_IFUPDOWN_IPV4 21 bool ' Enable support for IPv4' CONFIG_FEATURE_IFUPDOWN_IPV4
22 bool ' Enable support for IPv6 (requires ip command)' CONFIG_FEATURE_IFUPDOWN_IPV6 22 bool ' Enable support for IPv6 (requires ip command)' CONFIG_FEATURE_IFUPDOWN_IPV6
23 bool ' Enable support for IPX (requires ipx_interface command)' CONFIG_FEATURE_IFUPDOWN_IPX 23 bool ' Enable support for IPX (requires ipx_interface command)' CONFIG_FEATURE_IFUPDOWN_IPX
24 bool ' Mapping support' CONFIG_FEATURE_IFUPDOWN_MAPPING
25fi 24fi
26bool 'ip' CONFIG_IP 25bool 'ip' CONFIG_IP
27if [ "$CONFIG_IP" = "y" ]; then 26if [ "$CONFIG_IP" = "y" ]; then
diff --git a/networking/ifupdown.c b/networking/ifupdown.c
index b2dbb0d22..03eb0a5a7 100644
--- a/networking/ifupdown.c
+++ b/networking/ifupdown.c
@@ -58,7 +58,6 @@ typedef struct address_family {
58 method *method; 58 method *method;
59} address_family; 59} address_family;
60 60
61#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
62typedef struct mapping_defn { 61typedef struct mapping_defn {
63 struct mapping_defn *next; 62 struct mapping_defn *next;
64 63
@@ -72,7 +71,6 @@ typedef struct mapping_defn {
72 int n_mappings; 71 int n_mappings;
73 char **mapping; 72 char **mapping;
74} mapping_defn; 73} mapping_defn;
75#endif
76 74
77typedef struct variable { 75typedef struct variable {
78 char *name; 76 char *name;
@@ -99,9 +97,7 @@ typedef struct interfaces_file {
99 char **autointerfaces; 97 char **autointerfaces;
100 98
101 interface_defn *ifaces; 99 interface_defn *ifaces;
102#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
103 mapping_defn *mappings; 100 mapping_defn *mappings;
104#endif
105} interfaces_file; 101} interfaces_file;
106 102
107#define MAX_OPT_DEPTH 10 103#define MAX_OPT_DEPTH 10
@@ -684,9 +680,7 @@ static interfaces_file *read_interfaces(char *filename)
684{ 680{
685 interface_defn *currif = NULL; 681 interface_defn *currif = NULL;
686 interfaces_file *defn; 682 interfaces_file *defn;
687#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
688 mapping_defn *currmap = NULL; 683 mapping_defn *currmap = NULL;
689#endif
690 FILE *f; 684 FILE *f;
691 char firstword[80]; 685 char firstword[80];
692 char *buf = NULL; 686 char *buf = NULL;
@@ -699,9 +693,7 @@ static interfaces_file *read_interfaces(char *filename)
699 defn = xmalloc(sizeof(interfaces_file)); 693 defn = xmalloc(sizeof(interfaces_file));
700 defn->max_autointerfaces = defn->n_autointerfaces = 0; 694 defn->max_autointerfaces = defn->n_autointerfaces = 0;
701 defn->autointerfaces = NULL; 695 defn->autointerfaces = NULL;
702#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
703 defn->mappings = NULL; 696 defn->mappings = NULL;
704#endif
705 defn->ifaces = NULL; 697 defn->ifaces = NULL;
706 f = fopen(filename, "r"); 698 f = fopen(filename, "r");
707 if (f == NULL) { 699 if (f == NULL) {
@@ -716,7 +708,6 @@ static interfaces_file *read_interfaces(char *filename)
716 } 708 }
717 709
718 if (strcmp(firstword, "mapping") == 0) { 710 if (strcmp(firstword, "mapping") == 0) {
719#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
720 currmap = xmalloc(sizeof(mapping_defn)); 711 currmap = xmalloc(sizeof(mapping_defn));
721 currmap->max_matches = 0; 712 currmap->max_matches = 0;
722 currmap->n_matches = 0; 713 currmap->n_matches = 0;
@@ -743,7 +734,6 @@ static interfaces_file *read_interfaces(char *filename)
743 currmap->next = NULL; 734 currmap->next = NULL;
744 } 735 }
745 currently_processing = MAPPING; 736 currently_processing = MAPPING;
746#endif
747 } else if (strcmp(firstword, "iface") == 0) { 737 } else if (strcmp(firstword, "iface") == 0) {
748 { 738 {
749 char iface_name[80]; 739 char iface_name[80];
@@ -881,7 +871,6 @@ static interfaces_file *read_interfaces(char *filename)
881 currif->n_options++; 871 currif->n_options++;
882 break; 872 break;
883 case MAPPING: 873 case MAPPING:
884#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
885 if (strcmp(firstword, "script") == 0) { 874 if (strcmp(firstword, "script") == 0) {
886 if (currmap->script != NULL) { 875 if (currmap->script != NULL) {
887 error_msg("%s:%d: duplicate script in mapping", filename, line); 876 error_msg("%s:%d: duplicate script in mapping", filename, line);
@@ -900,7 +889,6 @@ static interfaces_file *read_interfaces(char *filename)
900 error_msg("%s:%d: misplaced option", filename, line); 889 error_msg("%s:%d: misplaced option", filename, line);
901 return NULL; 890 return NULL;
902 } 891 }
903#endif
904 break; 892 break;
905 case NONE: 893 case NONE:
906 default: 894 default:
@@ -1076,7 +1064,6 @@ static int iface_down(interface_defn *iface)
1076 return (1); 1064 return (1);
1077} 1065}
1078 1066
1079#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
1080static int popen2(FILE **in, FILE **out, char *command, ...) 1067static int popen2(FILE **in, FILE **out, char *command, ...)
1081{ 1068{
1082 va_list ap; 1069 va_list ap;
@@ -1158,7 +1145,6 @@ static int run_mapping(char *physical, char *logical, int len, mapping_defn * ma
1158 1145
1159 return 1; 1146 return 1;
1160} 1147}
1161#endif /* CONFIG_FEATURE_IFUPDOWN_MAPPING */
1162 1148
1163 1149
1164static int lookfor_iface(char **ifaces, int n_ifaces, char *iface) 1150static int lookfor_iface(char **ifaces, int n_ifaces, char *iface)
@@ -1197,9 +1183,7 @@ extern int ifupdown_main(int argc, char **argv)
1197 char *statefile = "/etc/network/ifstate"; 1183 char *statefile = "/etc/network/ifstate";
1198 1184
1199 int do_all = 0; 1185 int do_all = 0;
1200#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
1201 int run_mappings = 1; 1186 int run_mappings = 1;
1202#endif
1203 int force = 0; 1187 int force = 0;
1204 int n_target_ifaces = 0; 1188 int n_target_ifaces = 0;
1205 int n_state = 0; 1189 int n_state = 0;
@@ -1228,11 +1212,9 @@ extern int ifupdown_main(int argc, char **argv)
1228 case 'n': /* no-act */ 1212 case 'n': /* no-act */
1229 no_act = 1; 1213 no_act = 1;
1230 break; 1214 break;
1231#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
1232 case 'm': /* no-mappings */ 1215 case 'm': /* no-mappings */
1233 run_mappings = 0; 1216 run_mappings = 0;
1234 break; 1217 break;
1235#endif
1236 case 'f': /* force */ 1218 case 'f': /* force */
1237 force = 1; 1219 force = 1;
1238 break; 1220 break;
@@ -1356,7 +1338,6 @@ extern int ifupdown_main(int argc, char **argv)
1356 liface[79] = 0; 1338 liface[79] = 0;
1357 } 1339 }
1358 } 1340 }
1359#ifdef CONFIG_FEATURE_IFUPDOWN_MAPPING
1360 if ((cmds == iface_up) && run_mappings) { 1341 if ((cmds == iface_up) && run_mappings) {
1361 mapping_defn *currmap; 1342 mapping_defn *currmap;
1362 1343
@@ -1373,7 +1354,6 @@ extern int ifupdown_main(int argc, char **argv)
1373 } 1354 }
1374 } 1355 }
1375 } 1356 }
1376#endif
1377 1357
1378 for (currif = defn->ifaces; currif; currif = currif->next) { 1358 for (currif = defn->ifaces; currif; currif = currif->next) {
1379 if (strcmp(liface, currif->iface) == 0) { 1359 if (strcmp(liface, currif->iface) == 0) {