[lxc-devel] [lxc/lxc] fbb162: conf.c: fix unprivileged network case

GitHub noreply at github.com
Thu Dec 19 22:29:13 UTC 2013


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: fbb162594867de669301e989441cfe451752e40a
      https://github.com/lxc/lxc/commit/fbb162594867de669301e989441cfe451752e40a
  Author: Serge Hallyn <serge.hallyn at ubuntu.com>
  Date:   2013-12-19 (Thu, 19 Dec 2013)

  Changed paths:
    M src/lxc/conf.c

  Log Message:
  -----------
  conf.c: fix unprivileged network case

If unprivileged users are using a veth nic, then ifindex is still 0
at lxc_assign_network() (because lxc_create_network() was skipped).
So check for that case before we use lxc->ifindex to decide if we
have an empty network namespace.

We probably should change the !netdev->ifindex check to a
netdev->type == LXC_NET_EMPTY check, but I've been making enough
mistakes today not to risk that.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
Acked-by: Stéphane Graber <stgraber at ubuntu.com>




More information about the lxc-devel mailing list