mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-16 22:45:17 +08:00
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:
parent
cd8df30b7c
commit
531d5da413
3
ip/ip.c
3
ip/ip.c
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user