iproute2/ip
JunweiZhang 95592b47be ipbatch: fix use of 'ip netns exec'
execvp() does not return when the command succeed, hence all commands in the
batch file after the line 'ip netns exec' are not executed.

Let's fork before calling execvp() if batch mode is used..

Example:
$ cat test.batch
netns add netns1
netns exec netns1 ip l
netns
$ ip -b test.batch
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT
    link/sit 0.0.0.0 brd 0.0.0.0

All command after 'netns exec' are never executed.

With the patch:
$ ip -b test.batch
1: lo: <LOOPBACK> mtu 65536 qdisc noop state DOWN mode DEFAULT
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: sit0: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT
    link/sit 0.0.0.0 brd 0.0.0.0
netns1

Now, existing netns are displayed.

Signed-off-by: JunweiZhang <junwei.zhang@6wind.com>
Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com>
2013-07-09 09:14:10 -07:00
..
.gitignore Another .gitignore file. 2006-08-08 12:11:23 -07:00
ifcfg Remove trailing whitespace 2006-12-05 10:10:22 -08:00
ip6tunnel.c iproute2: improved error messages 2013-02-11 09:22:22 -08:00
ip_common.h ip: ipv6: add tokenized interface identifier support 2013-05-03 13:17:21 -07:00
ip.c ip: ipv6: add tokenized interface identifier support 2013-05-03 13:17:21 -07:00
ipaddress.c ip: remove unnecessary ll_init_map 2013-03-28 15:17:47 -07:00
ipaddrlabel.c ip: remove unnecessary ll_init_map 2013-03-28 15:17:47 -07:00
ipl2tp.c iproute2: add l2spec_type param to l2tp add session 2013-03-27 13:20:58 -07:00
iplink_can.c iproute2: improved error messages 2013-02-11 09:22:22 -08:00
iplink_ipoib.c iproute2: improved error messages 2013-02-11 09:22:22 -08:00
iplink_macvlan.c iproute2: improved error messages 2013-02-11 09:22:22 -08:00
iplink_macvtap.c iproute2: improved error messages 2013-02-11 09:22:22 -08:00
iplink_vlan.c ip: iplink_vlan: add 802.1ad support 2013-06-21 08:59:24 -07:00
iplink_vxlan.c vxlan: remove dstport option 2013-05-23 10:21:15 -07:00
iplink.c ip: remove unnecessary ll_init_map 2013-03-28 15:17:47 -07:00
ipmaddr.c ipmaddr: add whitespace around = 2013-03-14 13:44:25 -07:00
ipmonitor.c ip: make local functions static 2013-02-12 11:38:35 -08:00
ipmroute.c ip: use rtnelink to manage mroute 2012-12-14 10:08:17 -08:00
ipneigh.c ip: make local functions static 2013-02-12 11:38:35 -08:00
ipnetconf.c ipnetconf: by default dump all entries 2013-05-17 08:38:36 -07:00
ipnetns.c ipbatch: fix use of 'ip netns exec' 2013-07-09 09:14:10 -07:00
ipntable.c ipntable: more fixes for ppc64 2013-03-04 13:59:39 -08:00
ipprefix.c ip: make local functions static 2013-02-12 11:38:35 -08:00
iproute.c ip: fix build failure if time_t is not long int 2013-06-25 13:36:56 -07:00
iprule.c Convert to use rta_getattr_ functions 2012-04-10 08:47:55 -07:00
iptoken.c ip: ipv6: add tokenized interface identifier support 2013-05-03 13:17:21 -07:00
iptunnel.c iptunnel: check SIT_ISATAP flag only for SIT tunnel 2013-07-09 09:08:14 -07:00
iptuntap.c iptuntap: allow creation of multi-queue tun/tap device 2013-05-24 08:12:52 -07:00
ipxfrm.c ip/xfrm: all to set flag XFRM_SA_XFLAG_DONT_ENCAP_DSCP 2013-05-17 08:38:26 -07:00
link_gre.c iproute2: improved error messages 2013-02-11 09:22:22 -08:00
link_ip6tnl.c ip: add missing help about mode argument 2013-05-03 12:29:22 -07:00
link_iptnl.c ip/link_iptnl: fix indentation Logged in as shemminger 2012-12-14 09:50:33 -08:00
link_veth.c iproute2: support device group semantics 2011-02-25 12:43:14 -08:00
link_vti.c iproute2: improved error messages 2013-02-11 09:22:22 -08:00
Makefile ip: ipv6: add tokenized interface identifier support 2013-05-03 13:17:21 -07:00
routef ip/routef lifesaver 2007-07-10 18:29:20 -07:00
routel (Logical change 1.3) 2004-04-15 20:56:59 +00:00
rtm_map.c (Logical change 1.3) 2004-04-15 20:56:59 +00:00
rtmon.c ip: make local functions static 2013-02-12 11:38:35 -08:00
rtpr (Logical change 1.3) 2004-04-15 20:56:59 +00:00
static-syms.c Fix build when shared libraries are disabled 2013-03-13 08:29:59 -07:00
tcp_metrics.c fix dependency on sizeof(__u64) == sizeof(unsigned long long) 2013-02-28 08:51:46 -08:00
tunnel.c iproute2: improved error messages 2013-02-11 09:22:22 -08:00
tunnel.h Use standard routines for interface name to index etc 2010-11-28 10:35:28 -08:00
xfrm_monitor.c ip: remove unnecessary ll_init_map 2013-03-28 15:17:47 -07:00
xfrm_policy.c ip/xfrm: Improve error strings 2013-03-28 14:42:32 -07:00
xfrm_state.c ip/xfrm: all to set flag XFRM_SA_XFLAG_DONT_ENCAP_DSCP 2013-05-17 08:38:26 -07:00
xfrm.h xfrm security context support 2011-03-17 09:58:23 -07:00