[lxc-devel] [lxc/lxc] 8da624: network: retrieve the host's veth device ifindex

GitHub noreply at github.com
Mon Sep 4 02:17:45 UTC 2017


  Branch: refs/heads/master
  Home:   https://github.com/lxc/lxc
  Commit: 8da62485e8ae00819761a3f67386d496e2bb21ac
      https://github.com/lxc/lxc/commit/8da62485e8ae00819761a3f67386d496e2bb21ac
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-08-31 (Thu, 31 Aug 2017)

  Changed paths:
    M src/lxc/network.c

  Log Message:
  -----------
  network: retrieve the host's veth device ifindex

- Retrieve the host's veth device ifindex in the host's network namespace.
- Add a note why we retrieve the container's veth device ifindex in the host's
  network namespace.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: d0b915aab9c73022bc1aec29d344b9ae96483f6c
      https://github.com/lxc/lxc/commit/d0b915aab9c73022bc1aec29d344b9ae96483f6c
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-08-31 (Thu, 31 Aug 2017)

  Changed paths:
    M src/lxc/start.c

  Log Message:
  -----------
  start: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 8424b4e14b7f5c34ed6229d1001cd766a6bdc648
      https://github.com/lxc/lxc/commit/8424b4e14b7f5c34ed6229d1001cd766a6bdc648
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-08-31 (Thu, 31 Aug 2017)

  Changed paths:
    M src/lxc/lxc_user_nic.c

  Log Message:
  -----------
  lxc-user-nic: free memory and check for error

- check for error on ifindex retrieval
- free allocated memory

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 99573f4aeab96a8554ddb08c683769d16dda5332
      https://github.com/lxc/lxc/commit/99573f4aeab96a8554ddb08c683769d16dda5332
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-08-31 (Thu, 31 Aug 2017)

  Changed paths:
    M src/lxc/lxc_user_nic.c

  Log Message:
  -----------
  lxc-user-nic: initialize vars to silence gcc-7

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: de4855a8bc9cecfff180567889a784d938e4949b
      https://github.com/lxc/lxc/commit/de4855a8bc9cecfff180567889a784d938e4949b
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-01 (Fri, 01 Sep 2017)

  Changed paths:
    M src/lxc/confile.c
    M src/lxc/confile_legacy.c
    M src/lxc/confile_utils.c
    M src/lxc/confile_utils.h
    M src/lxc/criu.c
    M src/lxc/network.c
    M src/lxc/network.h
    M src/lxc/start.c

  Log Message:
  -----------
  network: use static memory for net device names

All network devices can only be of size < IFNAMSIZ. So let's spare the useless
heap allocations and use static memory.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 535e88591d30de27c56ffee0f7e95ffb3e143e7c
      https://github.com/lxc/lxc/commit/535e88591d30de27c56ffee0f7e95ffb3e143e7c
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-01 (Fri, 01 Sep 2017)

  Changed paths:
    M src/lxc/network.c
    M src/lxc/network.h

  Log Message:
  -----------
  network: non-functional changes

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: c6012571f3b42d80b8400b149d57e1099de47a8f
      https://github.com/lxc/lxc/commit/c6012571f3b42d80b8400b149d57e1099de47a8f
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-01 (Fri, 01 Sep 2017)

  Changed paths:
    M src/lxc/conf.c
    M src/lxc/start.c
    M src/lxc/start.h

  Log Message:
  -----------
  start: non-functional changes

This renames the socketpair() variable "ttysock" to "data_sock" since we will
use it to send arbitrary data around, not just ttys anymore.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 790255cf8e21fb4f984cb40b943e0ffcf14ef05a
      https://github.com/lxc/lxc/commit/790255cf8e21fb4f984cb40b943e0ffcf14ef05a
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-01 (Fri, 01 Sep 2017)

  Changed paths:
    M src/lxc/conf.c
    M src/lxc/network.c
    M src/lxc/network.h
    M src/lxc/start.c
    M src/lxc/start.h

  Log Message:
  -----------
  network: retrieve correct names and ifindices

On privileged network creation we only retrieved the names and ifindeces of
network devices in the host's network namespace. This meant that the monitor
process was acting on possibly incorrect information. With this commit we have
the child send back the correct device names and ifindeces in the container's
network namespace.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: b809f232286d5ad158efab0f15d42e0711c5ae12
      https://github.com/lxc/lxc/commit/b809f232286d5ad158efab0f15d42e0711c5ae12
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-01 (Fri, 01 Sep 2017)

  Changed paths:
    M src/lxc/conf.c
    M src/lxc/conf.h
    M src/lxc/confile_utils.c
    M src/lxc/network.c
    M src/lxc/network.h
    M src/lxc/start.c

  Log Message:
  -----------
  network: stop recording saved physical net devices

liblxc will now correctly log any network device names and ifindeces in their
respective network namespaces. So there's no need to record physical network
devices any more. This spares us heap allocations and memory we need to have
lying around til the container is shutdown.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 8843fde445d732e13c08d5875e98cd92d72dbe08
      https://github.com/lxc/lxc/commit/8843fde445d732e13c08d5875e98cd92d72dbe08
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-01 (Fri, 01 Sep 2017)

  Changed paths:
    M src/lxc/network.c

  Log Message:
  -----------
  network: use correct network device name

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 7ab1ba029bc91a035291f4b2cf60aafce58ab990
      https://github.com/lxc/lxc/commit/7ab1ba029bc91a035291f4b2cf60aafce58ab990
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-01 (Fri, 01 Sep 2017)

  Changed paths:
    M src/lxc/network.c
    M src/lxc/network.h
    M src/lxc/start.c

  Log Message:
  -----------
  network: remove netpipe

We use data_sock for all things we need to send around between parent and child
now. It doesn't make sense to have so many different pipes and sockets if one
will do just fine.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: a92028b27f9a5bf67930942fed616f5a7e71a0d1
      https://github.com/lxc/lxc/commit/a92028b27f9a5bf67930942fed616f5a7e71a0d1
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-02 (Sat, 02 Sep 2017)

  Changed paths:
    M src/lxc/lxc_user_nic.c

  Log Message:
  -----------
  lxc-user-nic: fix adding database entries

The code before inserted \0-bytes after every new line which made the db
basically unusable.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 323113452374c94e976431628a0e4aedad4b80fa
      https://github.com/lxc/lxc/commit/323113452374c94e976431628a0e4aedad4b80fa
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-02 (Sat, 02 Sep 2017)

  Changed paths:
    M src/lxc/lxc_user_nic.c

  Log Message:
  -----------
  lxc-user-nic: keep lines from other {users,links}

Assume the db contained the following entries:

    chb veth lxcbr0 veth1
    chb veth lxcbr0 veth2
    chb veth lxdbr0 veth3
    chb veth lxdbr0 veth2
    didi veth lxcbr0 veth4

And you request

    cull_entries("chb", "veth", "lxdbr0", "veth3");

lxc-user-nic would wipe any entries that did not match irrespective of whether
they existed or not. Let's fix that.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: d75c14e262cce3d5d200fc5a0c9e502d6301fa91
      https://github.com/lxc/lxc/commit/d75c14e262cce3d5d200fc5a0c9e502d6301fa91
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-03 (Sun, 03 Sep 2017)

  Changed paths:
    M src/lxc/lxc_user_nic.c
    M src/lxc/utils.c
    M src/lxc/utils.h

  Log Message:
  -----------
  utils: add lxc_nic_exists()

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 6d8c277969357e8af8cfda8ae6fe2438d28b84b4
      https://github.com/lxc/lxc/commit/6d8c277969357e8af8cfda8ae6fe2438d28b84b4
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-03 (Sun, 03 Sep 2017)

  Changed paths:
    M src/lxc/lxc_user_nic.c

  Log Message:
  -----------
  lxc-user-nic: bugfixes

Since find_line() was changed before count_entries() started counting lines
wrong. It would report maximum reached before you actually reached your alloted
maximum.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: d0fbc7bab7b83641a45c8622300c000621d046ad
      https://github.com/lxc/lxc/commit/d0fbc7bab7b83641a45c8622300c000621d046ad
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-03 (Sun, 03 Sep 2017)

  Changed paths:
    M src/lxc/conf.c
    M src/lxc/network.c
    M src/lxc/start.c
    M src/lxc/start.h

  Log Message:
  -----------
  handler: root -> am_root

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: a1ae535a4f52c55bdc7752e4d6d376d14a0f70f4
      https://github.com/lxc/lxc/commit/a1ae535a4f52c55bdc7752e4d6d376d14a0f70f4
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-03 (Sun, 03 Sep 2017)

  Changed paths:
    M src/lxc/conf.c
    M src/lxc/network.c
    M src/lxc/network.h
    M src/lxc/start.c

  Log Message:
  -----------
  network: user send()/recv()

Also move all functions to network.{c,h}.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 2958919632283dacfaf89ac9d1d9c3a027d3bdff
      https://github.com/lxc/lxc/commit/2958919632283dacfaf89ac9d1d9c3a027d3bdff
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-03 (Sun, 03 Sep 2017)

  Changed paths:
    M src/lxc/network.c

  Log Message:
  -----------
  network: fix grammar

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 966e9f1fc82662e4f9c330200490c121dacbd7c8
      https://github.com/lxc/lxc/commit/966e9f1fc82662e4f9c330200490c121dacbd7c8
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-03 (Sun, 03 Sep 2017)

  Changed paths:
    M src/lxc/criu.c
    M src/lxc/lxc_user_nic.c
    M src/lxc/network.c
    M src/lxc/network.h

  Log Message:
  -----------
  network: remove allocation from lxc_mkifname()

lxc_mkifname() really doesn't need to allocate any memory.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: cb5659e1cda4b1fc3a588098dc7615fffc6d2852
      https://github.com/lxc/lxc/commit/cb5659e1cda4b1fc3a588098dc7615fffc6d2852
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-03 (Sun, 03 Sep 2017)

  Changed paths:
    M src/lxc/lxc_user_nic.c

  Log Message:
  -----------
  lxc-user-nic: simplify

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 672c1e58218fef0489ab6e31d80184f5de10af6c
      https://github.com/lxc/lxc/commit/672c1e58218fef0489ab6e31d80184f5de10af6c
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-04 (Mon, 04 Sep 2017)

  Changed paths:
    M src/lxc/conf.c
    M src/lxc/start.c

  Log Message:
  -----------
  conf: send ttys in batches of 2

I thought we could send all ttys at once but this limits the number of ttys
users can use because of iovec_len restrictions. So let's sent them in batches
of 2.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: b9f522c5b48b479d39490e1ef0b8e905dbc0cf10
      https://github.com/lxc/lxc/commit/b9f522c5b48b479d39490e1ef0b8e905dbc0cf10
  Author: Christian Brauner <christian.brauner at ubuntu.com>
  Date:   2017-09-04 (Mon, 04 Sep 2017)

  Changed paths:
    M src/lxc/start.c

  Log Message:
  -----------
  start: switch from SOCK_DGRAM to SOCK_STREAM

Writes < PIPE_BUF will be atomic. PIPE_BUF is guaranteed to be 512 by POSIX and
Linux guarantess 4096. Nothing we send around goes over this limit.

Signed-off-by: Christian Brauner <christian.brauner at ubuntu.com>


  Commit: 36259ede73c140228049f93e86291ce2715f3402
      https://github.com/lxc/lxc/commit/36259ede73c140228049f93e86291ce2715f3402
  Author: Serge Hallyn <serge at hallyn.com>
  Date:   2017-09-03 (Sun, 03 Sep 2017)

  Changed paths:
    M src/lxc/conf.c
    M src/lxc/conf.h
    M src/lxc/confile.c
    M src/lxc/confile_legacy.c
    M src/lxc/confile_utils.c
    M src/lxc/confile_utils.h
    M src/lxc/criu.c
    M src/lxc/lxc_user_nic.c
    M src/lxc/network.c
    M src/lxc/network.h
    M src/lxc/start.c
    M src/lxc/start.h
    M src/lxc/utils.c
    M src/lxc/utils.h

  Log Message:
  -----------
  Merge pull request #1773 from brauner/2017-08-31/ensure_lxc_user_nic_tests_privilege_over_netns

network: improvements + bugfixes


Compare: https://github.com/lxc/lxc/compare/db3c8336ac89...36259ede73c1


More information about the lxc-devel mailing list