]> git.ipfire.org Git - thirdparty/iproute2.git/commitdiff
ip: Fix batch processing
authorPetr Machata <petrm@nvidia.com>
Wed, 17 Mar 2021 12:24:14 +0000 (13:24 +0100)
committerStephen Hemminger <stephen@networkplumber.org>
Mon, 22 Mar 2021 23:30:21 +0000 (16:30 -0700)
After the comment cited below, batch mode neglects to set the global
variable batch_mode to a non-zero value. Netns and VRF commands use this
variable, and break in batch mode. Fix by setting the value again.

Fixes: 1d9a81b8c9f3 ("Unify batch processing across tools")
Reported-by: Tim Rice <trice@posteo.net>
Signed-off-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
ip/ip.c

diff --git a/ip/ip.c b/ip/ip.c
index c561c01f6810bb5f88e69c37e4219d4e1aade170..4cf09fc3b8cec6d70a4f4e50095683869927a3a2 100644 (file)
--- a/ip/ip.c
+++ b/ip/ip.c
@@ -156,6 +156,7 @@ static int batch(const char *name)
                return EXIT_FAILURE;
        }
 
+       batch_mode = 1;
        ret = do_batch(name, force, ip_batch_cmd, &orig_family);
 
        rtnl_close(&rth);