ip: Preserve original portocol family in batch mode

Reset the 'preferred_family' global variable
to its initially set value before each batch
file command is processed.

Signed-off-by: Antti Paila <antti.paila@gmail.com>
This commit is contained in:
Antti Paila 2015-07-31 13:55:31 +03:00 committed by Stephen Hemminger
parent cd8df30b7c
commit 531d5da413

View File

@ -118,6 +118,7 @@ static int batch(const char *name)
char *line = NULL;
size_t len = 0;
int ret = EXIT_SUCCESS;
int orig_family = preferred_family;
batch_mode = 1;
@ -140,6 +141,8 @@ static int batch(const char *name)
char *largv[100];
int largc;
preferred_family = orig_family;
largc = makeargs(line, largv, 100);
if (largc == 0)
continue; /* blank line */