Netdev List
 help / color / mirror / Atom feed
* [PATCH] ip: Preserve original portocol family in batch mode
@ 2015-07-31 10:55 Antti Paila
  2015-08-01  1:11 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Antti Paila @ 2015-07-31 10:55 UTC (permalink / raw)
  To: netdev; +Cc: Antti Paila

From: Antti Paila <antti.paila@gmail.com>

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>
---
 ip/ip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ip/ip.c b/ip/ip.c
index 3d993b9..0cf743f 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 */
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-08-01  1:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-31 10:55 [PATCH] ip: Preserve original portocol family in batch mode Antti Paila
2015-08-01  1:11 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox