Quoting Dongsheng Yang (yangds.f...@cn.fujitsu.com): > When we want to get index of a ifname which does not > exist, we should return a -EINVAL in this case. > > Signed-off-by: Dongsheng Yang <yangds.f...@cn.fujitsu.com>
Acked-by: Serge E. Hallyn <serge.hal...@ubuntu.com> > --- > src/lxc/network.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/src/lxc/network.c b/src/lxc/network.c > index ce10d31..909f3fe 100644 > --- a/src/lxc/network.c > +++ b/src/lxc/network.c > @@ -144,6 +144,8 @@ int lxc_netdev_move_by_name(const char *ifname, pid_t pid) > return -EINVAL; > > index = if_nametoindex(ifname); > + if (!index) > + return -EINVAL; > > return lxc_netdev_move_by_index(index, pid); > } > -- > 1.8.4.2 > _______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel