diff options
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r-- | networking/ifupdown.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index d23c9f70a..757827858 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -12,19 +12,7 @@ | |||
12 | * Lines in the interfaces file cannot wrap. | 12 | * Lines in the interfaces file cannot wrap. |
13 | * To adhere to the FHS, the default state file is /var/run/ifstate. | 13 | * To adhere to the FHS, the default state file is /var/run/ifstate. |
14 | * | 14 | * |
15 | * This program is free software; you can redistribute it and/or modify | 15 | * Licensed under the GPL v2 or later, see the file LICENSE in this tarball. |
16 | * it under the terms of the GNU General Public License as published by | ||
17 | * the Free Software Foundation; either version 2 of the License, or | ||
18 | * (at your option) any later version. | ||
19 | * | ||
20 | * This program is distributed in the hope that it will be useful, | ||
21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
23 | * GNU General Public License for more details. | ||
24 | * | ||
25 | * You should have received a copy of the GNU General Public License | ||
26 | * along with this program; if not, write to the Free Software | ||
27 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
28 | */ | 16 | */ |
29 | 17 | ||
30 | /* TODO: standardise execute() return codes to return 0 for success and 1 for failure */ | 18 | /* TODO: standardise execute() return codes to return 0 for success and 1 for failure */ |
@@ -819,7 +807,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename) | |||
819 | } | 807 | } |
820 | 808 | ||
821 | /* Add the interface to the list */ | 809 | /* Add the interface to the list */ |
822 | defn->autointerfaces = llist_add_to_end(defn->autointerfaces, strdup(firstword)); | 810 | defn->autointerfaces = llist_add_to_end(defn->autointerfaces, bb_xstrdup(firstword)); |
823 | debug_noise("\nauto %s\n", firstword); | 811 | debug_noise("\nauto %s\n", firstword); |
824 | } | 812 | } |
825 | currently_processing = NONE; | 813 | currently_processing = NONE; |
@@ -1254,7 +1242,7 @@ extern int ifupdown_main(int argc, char **argv) | |||
1254 | const llist_t *list = state_list; | 1242 | const llist_t *list = state_list; |
1255 | while (list) { | 1243 | while (list) { |
1256 | new_item = xmalloc(sizeof(llist_t)); | 1244 | new_item = xmalloc(sizeof(llist_t)); |
1257 | new_item->data = strdup(list->data); | 1245 | new_item->data = bb_xstrdup(list->data); |
1258 | new_item->link = NULL; | 1246 | new_item->link = NULL; |
1259 | list = target_list; | 1247 | list = target_list; |
1260 | if (list == NULL) | 1248 | if (list == NULL) |
@@ -1273,7 +1261,7 @@ extern int ifupdown_main(int argc, char **argv) | |||
1273 | /* iface_down */ | 1261 | /* iface_down */ |
1274 | const llist_t *list = state_list; | 1262 | const llist_t *list = state_list; |
1275 | while (list) { | 1263 | while (list) { |
1276 | target_list = llist_add_to_end(target_list, strdup(list->data)); | 1264 | target_list = llist_add_to_end(target_list, bb_xstrdup(list->data)); |
1277 | list = list->link; | 1265 | list = list->link; |
1278 | } | 1266 | } |
1279 | target_list = defn->autointerfaces; | 1267 | target_list = defn->autointerfaces; |
@@ -1294,15 +1282,15 @@ extern int ifupdown_main(int argc, char **argv) | |||
1294 | int okay = 0; | 1282 | int okay = 0; |
1295 | int cmds_ret; | 1283 | int cmds_ret; |
1296 | 1284 | ||
1297 | iface = strdup(target_list->data); | 1285 | iface = bb_xstrdup(target_list->data); |
1298 | target_list = target_list->link; | 1286 | target_list = target_list->link; |
1299 | 1287 | ||
1300 | pch = strchr(iface, '='); | 1288 | pch = strchr(iface, '='); |
1301 | if (pch) { | 1289 | if (pch) { |
1302 | *pch = '\0'; | 1290 | *pch = '\0'; |
1303 | liface = strdup(pch + 1); | 1291 | liface = bb_xstrdup(pch + 1); |
1304 | } else { | 1292 | } else { |
1305 | liface = strdup(iface); | 1293 | liface = bb_xstrdup(iface); |
1306 | } | 1294 | } |
1307 | 1295 | ||
1308 | if (!force) { | 1296 | if (!force) { |