From: Antti Paila Date: Fri, 31 Jul 2015 10:55:31 +0000 (+0300) Subject: ip: Preserve original portocol family in batch mode X-Git-Tag: v4.2.0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=531d5da413a829d4795b66c62ff6be72114d5363;p=thirdparty%2Fiproute2.git 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 --- diff --git a/ip/ip.c b/ip/ip.c index 3d993b9e4..0cf743f71 100644 --- a/ip/ip.c +++ b/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 */