1. 12 Sep, 2016 2 commits
    • Thomas Haller's avatar
      device: change default value for cloned-mac-address to "preserve" (bgo#770611) · fae5ecec
      Thomas Haller authored
      Long ago before commit 1b49f941, NetworkManager did not touch the
      MAC address at all. Since 0.8.2 NetworkManager would modify the
      MAC address, and eventually it would reset the permanent MAC address
      of the device.
      
      This prevents a user from externally setting the MAC address via tools
      like macchanger and rely on NetworkManager not to reset it to the
      permanent MAC address. This is considered a security regression in
      bgo#708820.
      
      This only changed with commit 9a354cdc and 1.4.0. Since then it is possible
      to configure "cloned-mac-address=preserve", which instead uses the "initial"
      MAC address when the device activates.
      That also changed that the "initial" MAC address is the address which was
      externally configured on the device as last. In other words, the
      "initial" MAC address is picked up from external changes, unless it
      was NetworkManager itself who configured the address when activating a
      connection.
      
      However, in absence of an explicit configuration the default for
      "cloned-mac-address" is still "permanent". Meaning, the user has to
      explicitly configure that NetworkManager should not touch the MAC address.
      It makes sense to change the upstream default to "preserve". Although this
      is a change in behavior since 0.8.2, it seems a better default.
      
      This change has the drastic effect that all the existing connections
      out there with "cloned-mac-address=$(nil)" change behavior after upgrade.
      I think most users won't notice, because their devices have the permanent
      address set by default anyway. I would think that there are few users
      who intentionally configured "cloned-mac-address=" to have NetworkManager
      restore the permanent address.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=770611
      fae5ecec
    • Thomas Haller's avatar
      build: disable type checks in G_TYPE_CHECK_INSTANCE_CAST() macros (bgo#771120) · eb8da4c2
      Thomas Haller authored
      Avoid the pointless overhead. Even glib disables them unless you build
      with --enable-debug.
      
      https://bugzilla.gnome.org/show_bug.cgi?id=771120
      eb8da4c2
  2. 09 Sep, 2016 10 commits
  3. 08 Sep, 2016 8 commits
  4. 07 Sep, 2016 16 commits
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      dhcp: call synchronous Notify D-Bus method from nm-dhcp-helper · 2856a658
      Thomas Haller authored
      A D-Bus signal is asynchronous and it can happen that nm-dhcp-helper
      emits the "Event" signal before the server is able to register a handler:
      
         NM_DHCP_HELPER=/usr/libexec/nm-dhcp-helper
         nmcli general logging level TRACE
         for i in `seq 1 500`; do $NM_DHCP_HELPER & done
         journalctl -u NetworkManager --since '1 min ago' | grep "didn't have associated interface" | wc -l
          499
      
      Avoid that, by calling the synchronous D-Bus method "Notify".
      
      Interestingly, this race seem to exist since 2007.
      
      Actually, we called g_dbus_connection_signal_subscribe() from inside
      GDBusServer:new-connection signal. So it is not clear how such a race
      could exist. I was not able to reproduce it by putting a sleep
      before g_dbus_connection_signal_subscribe(). On the other hand, there
      is bug rh#1372854 and above reproducer which strongly indicates that
      events can be lost under certain circumstances.
      Now we instead g_dbus_connection_register_object() from the
      new-connection signal. According to my tests there was no more race
      as also backed by glib's documentation. Still, keep a simple retry-loop
      in nm-dhcp-helper just to be sure.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1372854
      https://bugzilla.redhat.com/show_bug.cgi?id=1373276
      2856a658
    • Thomas Haller's avatar
      7684b68c
    • Thomas Haller's avatar
      cc89996c
    • Thomas Haller's avatar
      dhcp-helper: refactor error handling · bb489163
      Thomas Haller authored
      Don't exit(1) from fatal_error() because that skips destroying
      local variables in main(). Just return regularly.
      bb489163
    • Thomas Haller's avatar
      dhcp-listener/trivial: rename field to track connections in NMDhcpListener · 2dd3a524
      Thomas Haller authored
      It's not "signal-handles", as it currently tracks the registration ID of
      type int. Rename it, it is effectively the list of connections that we
      track.
      2dd3a524
    • Thomas Haller's avatar
      d37cd04f
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      core: use _NM_GET_PRIVATE() macros · cdf6ad40
      Thomas Haller authored
      cdf6ad40
    • Thomas Haller's avatar
      shared: add _NM_GET_PRIVATE() macro · 2cae9ba3
      Thomas Haller authored
      2cae9ba3
    • Thomas Haller's avatar
    • Thomas Haller's avatar
      logging: don't round subsecond part in logging timestamp · c1b4b99a
      Thomas Haller authored
      tv.tv_usec is guaranteed to have less then 6 digits, however rounding it up
      we might reach 1000000 and thus the value becomes mis-aligned. To round
      correctly, we would have to carry over a potential overflow to the seconds.
      But that seems too much effort for little gain. Just truncate the value.
      c1b4b99a
    • Thomas Haller's avatar
      systemd: merge branch systemd into master · ee723b2a
      Thomas Haller authored
      ee723b2a
    • Thomas Haller's avatar
      systemd: update code from upstream · a1efdc2b
      Thomas Haller authored
      This is a direct dump from systemd git on 2016-09-07, git commit
      c5d5fc91eba8541a3a86ff6b839a2b6e824f4149.
      
      ======
      
      SYSTEMD_DIR=../systemd
      COMMIT=c5d5fc91eba8541a3a86ff6b839a2b6e824f4149
      
      (
        cd "$SYSTEMD_DIR"
        git checkout "$COMMIT"
        git reset --hard
        git clean -fdx
      )
      
      git ls-files :/src/systemd/src/ | xargs -d '\n' rm -f
      
      nm_copy_sd() {
          mkdir -p "./src/systemd/$(dirname "$1")"
          cp "$SYSTEMD_DIR/$1" "./src/systemd/$1"
      }
      
      nm_copy_sd "src/basic/alloc-util.c"
      nm_copy_sd "src/basic/alloc-util.h"
      nm_copy_sd "src/basic/async.h"
      nm_copy_sd "src/basic/escape.c"
      nm_copy_sd "src/basic/escape.h"
      nm_copy_sd "src/basic/ether-addr-util.c"
      nm_copy_sd "src/basic/ether-addr-util.h"
      nm_copy_sd "src/basic/extract-word.c"
      nm_copy_sd "src/basic/extract-word.h"
      nm_copy_sd "src/basic/fileio.c"
      nm_copy_sd "src/basic/fileio.h"
      nm_copy_sd "src/basic/fd-util.c"
      nm_copy_sd "src/basic/fd-util.h"
      nm_copy_sd "src/basic/fs-util.c"
      nm_copy_sd "src/basic/fs-util.h"
      nm_copy_sd "src/basic/hash-funcs.c"
      nm_copy_sd "src/basic/hash-funcs.h"
      nm_copy_sd "src/basic/hashmap.c"
      nm_copy_sd "src/basic/hashmap.h"
      nm_copy_sd "src/basic/hexdecoct.c"
      nm_copy_sd "src/basic/hexdecoct.h"
      nm_copy_sd "src/basic/hostname-util.c"
      nm_copy_sd "src/basic/hostname-util.h"
      nm_copy_sd "src/basic/in-addr-util.c"
      nm_copy_sd "src/basic/in-addr-util.h"
      nm_copy_sd "src/basic/io-util.c"
      nm_copy_sd "src/basic/io-util.h"
      nm_copy_sd "src/basic/list.h"
      nm_copy_sd "src/basic/log.h"
      nm_copy_sd "src/basic/macro.h"
      nm_copy_sd "src/basic/mempool.h"
      nm_copy_sd "src/basic/mempool.c"
      nm_copy_sd "src/basic/parse-util.c"
      nm_copy_sd "src/basic/parse-util.h"
      nm_copy_sd "src/basic/path-util.c"
      nm_copy_sd "src/basic/path-util.h"
      nm_copy_sd "src/basic/prioq.h"
      nm_copy_sd "src/basic/prioq.c"
      nm_copy_sd "src/basic/random-util.c"
      nm_copy_sd "src/basic/random-util.h"
      nm_copy_sd "src/basic/refcnt.h"
      nm_copy_sd "src/basic/set.h"
      nm_copy_sd "src/basic/signal-util.h"
      nm_copy_sd "src/basic/siphash24.c"
      nm_copy_sd "src/basic/siphash24.h"
      nm_copy_sd "src/basic/socket-util.c"
      nm_copy_sd "src/basic/socket-util.h"
      nm_copy_sd "src/basic/sparse-endian.h"
      nm_copy_sd "src/basic/stdio-util.h"
      nm_copy_sd "src/basic/string-table.c"
      nm_copy_sd "src/basic/string-table.h"
      nm_copy_sd "src/basic/string-util.c"
      nm_copy_sd "src/basic/string-util.h"
      nm_copy_sd "src/basic/strv.c"
      nm_copy_sd "src/basic/strv.h"
      nm_copy_sd "src/basic/time-util.c"
      nm_copy_sd "src/basic/time-util.h"
      nm_copy_sd "src/basic/umask-util.h"
      nm_copy_sd "src/basic/unaligned.h"
      nm_copy_sd "src/basic/utf8.c"
      nm_copy_sd "src/basic/utf8.h"
      nm_copy_sd "src/basic/util.c"
      nm_copy_sd "src/basic/util.h"
      nm_copy_sd "src/libsystemd-network/arp-util.c"
      nm_copy_sd "src/libsystemd-network/arp-util.h"
      nm_copy_sd "src/libsystemd-network/dhcp6-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp6-lease-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp6-network.c"
      nm_copy_sd "src/libsystemd-network/dhcp6-option.c"
      nm_copy_sd "src/libsystemd-network/dhcp6-protocol.h"
      nm_copy_sd "src/libsystemd-network/dhcp-identifier.c"
      nm_copy_sd "src/libsystemd-network/dhcp-identifier.h"
      nm_copy_sd "src/libsystemd-network/dhcp-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp-lease-internal.h"
      nm_copy_sd "src/libsystemd-network/dhcp-network.c"
      nm_copy_sd "src/libsystemd-network/dhcp-option.c"
      nm_copy_sd "src/libsystemd-network/dhcp-packet.c"
      nm_copy_sd "src/libsystemd-network/dhcp-protocol.h"
      nm_copy_sd "src/libsystemd-network/lldp-internal.h"
      nm_copy_sd "src/libsystemd-network/lldp-neighbor.c"
      nm_copy_sd "src/libsystemd-network/lldp-neighbor.h"
      nm_copy_sd "src/libsystemd-network/lldp-network.c"
      nm_copy_sd "src/libsystemd-network/lldp-network.h"
      nm_copy_sd "src/libsystemd-network/network-internal.c"
      nm_copy_sd "src/libsystemd-network/network-internal.h"
      nm_copy_sd "src/libsystemd-network/sd-dhcp6-client.c"
      nm_copy_sd "src/libsystemd-network/sd-dhcp6-lease.c"
      nm_copy_sd "src/libsystemd-network/sd-dhcp-client.c"
      nm_copy_sd "src/libsystemd-network/sd-dhcp-lease.c"
      nm_copy_sd "src/libsystemd-network/sd-ipv4ll.c"
      nm_copy_sd "src/libsystemd-network/sd-ipv4acd.c"
      nm_copy_sd "src/libsystemd-network/sd-lldp.c"
      nm_copy_sd "src/libsystemd/sd-event/sd-event.c"
      nm_copy_sd "src/libsystemd/sd-id128/id128-util.c"
      nm_copy_sd "src/libsystemd/sd-id128/id128-util.h"
      nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c"
      nm_copy_sd "src/shared/dns-domain.c"
      nm_copy_sd "src/shared/dns-domain.h"
      nm_copy_sd "src/systemd/_sd-common.h"
      nm_copy_sd "src/systemd/sd-dhcp6-client.h"
      nm_copy_sd "src/systemd/sd-dhcp6-lease.h"
      nm_copy_sd "src/systemd/sd-dhcp-client.h"
      nm_copy_sd "src/systemd/sd-dhcp-lease.h"
      nm_copy_sd "src/systemd/sd-event.h"
      nm_copy_sd "src/systemd/sd-ndisc.h"
      nm_copy_sd "src/systemd/sd-id128.h"
      nm_copy_sd "src/systemd/sd-ipv4acd.h"
      nm_copy_sd "src/systemd/sd-ipv4ll.h"
      nm_copy_sd "src/systemd/sd-lldp.h"
      a1efdc2b
    • Thomas Haller's avatar
      ifupdown: add curly braces to for loop · 0ef8e98e
      Thomas Haller authored
      0ef8e98e
    • Scott Sweeny's avatar
      plugins: ifupdown: support source-directory stanza · ada6b96d
      Scott Sweeny authored
      Enable the ifupdown settings plugin to read interface
      definitions from the source directory:
      
      /etc/network/interfaces.d/
      
      https://mail.gnome.org/archives/networkmanager-list/2016-September/msg00014.html
      ada6b96d
  5. 06 Sep, 2016 4 commits