1. 10 Nov, 2011 40 commits
    • Dan Williams's avatar
      c15dea29
    • Thomas Graf's avatar
      bonding: apply bonding settings when setting up bonding device · 3ef7bca6
      Thomas Graf authored
      Adds a new function nm_system_apply_bonding_config() which applies
      the parameters specified in the NMSettingBond object via sysfs.
      
      Calls that function after creating/updating the bonding master
      device.
      
      If a parameter is not specified in the ifcfg the parameter will be
      re-initialized to the default value. This may overwrite changes
      which have been done manually via sysfs but it is the only reliable
      way of setting up the bond.
      
      Supported parameters for now:
       - mode (default: balance-rr)
       - miimon (default: 100)
       - updelay (default: 0)
       - downdelay (default: 0)
       - arp_interval (default: 0)
       - arp_ip_target (default: none)
      
      Thomas Graf <tgraf@redhat.com>
      3ef7bca6
    • Thomas Graf's avatar
      core: convert nm_system_get_link_type() to return an int · d839e1c8
      Thomas Graf authored
      Kills the strdup() and avoids having the caller free the memory. Also renames
      the function to nm_system_get_iface_type() since "link" is not a common term
      in NM.
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
      d839e1c8
    • Thomas Graf's avatar
      netlink: Fix #if check if HAVE_LIBNL1 and HAVE_LIBNL2 are not defined · e654bb8d
      Thomas Graf authored
      Need to use #if defined HAVE_LIBNL1 instead of #if HAVE_LIBNL1.
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
      e654bb8d
    • Thomas Graf's avatar
      bonding: don't fall back to DHCP if IP config is missing · ae22fffe
      Thomas Graf authored
      If the IP config is missing, we just don't do any IP config, instead
      of treating it as DHCP as happens for all other interface types.
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
      ae22fffe
    • Thomas Graf's avatar
      bonding: enslave/release bonding slaves in activation/deactivation · b496355b
      Thomas Graf authored
      Code is written generic enough to allow easy addition of further master/slave
      relationships such as bridging relations.
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
      
      (whitespace cleanups and libnl compat by dcbw)
      b496355b
    • Thomas Graf's avatar
      bonding: postpone auto-activation of a slave until master is present · a65028a0
      Thomas Graf authored
      For a slave to be activatetable the master connection must be present.
      Activation of the slave is postponed until this condition is met.
      
      Once the slave is being activated, a reference to the master connection
      is acquired and held for the lifetime of the bond.
      
      Changes v2:
       - Made check_master_dependency() return TRUE/FALSE
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
      a65028a0
    • Thomas Graf's avatar
      bonding: implement bonding slaves · 6349151d
      Thomas Graf authored
      Adds a MASTER= directive to ifcfg-rh allowing a connection to define
      itself as bonding slave.
      
      Adds a connection property "master" which contains the in-kernel device
      name or UUID of the master connection.
      
      Adds a connection property "slave-type" which defines the type of slave
      this connection represents. Currently this is only set by bonding but
      eventually this will be used by VLAN and bridging.
      
      Enforces that no bonding slave connection has any IPv4 or IPv6
      configuration set.
      
      Changes make_ip4_setting() to take a universal flag indicating whether
      to allow disabling ip4 config or not and use it for both, ip6 and
      bonding special case.
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
      6349151d
    • Thomas Graf's avatar
      bonding: detect virtual bonding devices and create an ethernet device · 8d5af598
      Thomas Graf authored
      A bonding device is like a virtual ethernet device. We therefore reuse
      nm-device-ethernet and add some special handling to detect bonding
      connections.
      
      Changes v2:
       - Fixed memory leak
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
      8d5af598
    • Thomas Graf's avatar
      bonding: kernel bonding device creation · 095aff0c
      Thomas Graf authored
      Creates virtual kernel devices as needed. Since the manager is
      initialized after the connections have been loaded no
      CONNECTIONS_ADDED notification is received for connections parsed
      at startup.
      
      Therefore walks the loaded connections looking for bonding
      connections.
      
      Connections added on the fly are handled via the notifications.
      
      Connection renaming and deleting is not supported yet.
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
      095aff0c
    • Thomas Graf's avatar
      bonding: settings parser for ifcfg plugin + NMSettingBond class · a2a0d788
      Thomas Graf authored
      Introduced a new TYPE=bond for ifcfg-rh configuration files.
      Alternatively BONDING_MASTER=yes can be specified instead of
      setting the type explicitely to maintain backwards compatibility
      with existing configuration files.
      
      Bonding device files require a DEVICE= line to be present which
      specifies the virtual bonding interface in the kernel. We do not
      allow auto-generation of the name in order to keep confusion to
      a minimum when reusing existing bonding interfaces.
      
      The BONDING_OPTS= parameter can be used to specify various bonding
      related options, such as:
        - mode
        - miimon
        - updelay
        - downdelay
        - arp_interval
        - arp_ip_target
      
      By default, the NMSettingBond class uses a miimon value of 100 which
      seems like a sensible default value for 99% of all configurations.
      If this is not suitable, an arp_ip_target needs to be specified
      manually.
      
      A writer is not yet implemented.
      
      Changes v2:
       - renamed DeviceName property to InterfaceName
       - moved code to validate device name to dev_valid_name() for future use
      Signed-off-by: default avatarThomas Graf <tgraf@redhat.com>
      a2a0d788
    • Dan Williams's avatar
      firewall: remove nm-firewall-types.h · d0b71957
      Dan Williams authored
      No need for it.
      d0b71957
    • Dan Williams's avatar
      firewall: cleanups and code consolidation · cf7ec0e6
      Dan Williams authored
      Consolidate the NMDevice firewall add code so that firewall
      handling is done in one place.
      cf7ec0e6
    • Dan Williams's avatar
      libnm-util: fix up connection diff test · bc628da1
      Dan Williams authored
      bc628da1
    • Dan Williams's avatar
      40fc428f
    • Dan Williams's avatar
      04ecdb81
    • Jiri Popelka's avatar
    • Jiri Popelka's avatar
      firewall: add firewall manager · 1c0aeb45
      Jiri Popelka authored
      src/firewall-manager tracks whether firewall is on the bus or not.
      In nm-device.c at stage5 (ip-config-commit) before we actually
      apply the IP configuration to the interface, we send the
      IP interface name and zone to firewall and asynchronously wait
      for a D-Bus reply.  Then after we get the reply
      (or if the firewall isn't running) we proceed with
      applying the IP configuration to the interface.
      1c0aeb45
    • Jiri Popelka's avatar
      nmcli: add zone field to 'con status' · 9963a41d
      Jiri Popelka authored
      9963a41d
    • Jiri Popelka's avatar
      3e11682d
    • Jiri Popelka's avatar
      libnm-util: new 'zone' property for NMSettingConnection · 04c8ec73
      Jiri Popelka authored
      Used to indicate what firewall zone the interface should be in
      when the connection is active.
      04c8ec73
    • Dan Williams's avatar
      trivial: fix misspelling · 88faa0e0
      Dan Williams authored
      88faa0e0
    • Dan Williams's avatar
      ip6: save autoconf config when starting DHCP · 56513f52
      Dan Williams authored
      Otherwise it just gets lost, and we want it later to combine with
      the DHCP config to get the final config that's applied to the interface.
      56513f52
    • Dan Williams's avatar
      ip6: print RA flags description · 314d0968
      Dan Williams authored
      Helps debugging:
      
      'S' = RS_SENT
      'R' = RA_RCVD
      'O' = OTHERCONF
      'M' = MANAGED
      314d0968
    • Dan Williams's avatar
      core: combine DHCP and RA IPv6 configs when either changes · 8434f3b3
      Dan Williams authored
      Since both RA and DHCP may be run at the same time, we want to
      make sure to merge both configs into a final config when either
      RA or DHCP changes.  Previously this only happened when RA changed,
      but not when DHCP changed or completed.  This caused the config
      applied when DHCP completed to not contain the RA-derived address,
      which was then removed from the device, which then regressed the
      IPv6 RA state, causing a device failure.
      
      Found by Tore Anderson
      
      Oct 18 18:35:00 wrath dhclient[13782]: RCV: Reply message on eth0 from fe80::ca6c:87ff:feab:da5f.
      Oct 18 18:35:00 wrath NetworkManager[12390]: <info> (eth0): DHCPv6 state changed nbi -> renew6
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642273] [nm-device.c:1582] dhcp6_state_changed(): (eth0): new DHCPv6 client state 7
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642282] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'interface'=>'eth0'
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642288] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'new_dhcp6_client_id'=>'0:3:0:1:0:30:1b:bc:7f:23'
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642294] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'reason'=>'RENEW6'
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642300] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'new_dhcp6_name_servers'=>'2001:840:100:: 2001:840:200::'
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642305] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'new_dhcp6_server_id'=>'0:3:0:1:c8:6c:87:ab:da:5f'
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.642311] [nm-dhcp-client.c:1211] ip6_options_to_config(): (eth0): option 'pid'=>'13782'
      Oct 18 18:35:00 wrath NetworkManager[12390]: <info> Activation (eth0) Stage 5 of 5 (IPv6 Commit) scheduled...
      Oct 18 18:35:00 wrath NetworkManager[12390]: <info> Activation (eth0) Stage 5 of 5 (IPv6 Commit) started...
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.643641] [nm-system.c:182] sync_addresses(): (eth0): syncing addresses (family 10)
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.643655] [nm-system.c:235] sync_addresses(): (eth0): removing address '2001:840:3033:20:230:1bff:febc:7f23/64'
      Oct 18 18:35:00 wrath NetworkManager[12390]: <debug> [1318955700.643702] [nm-system.c:218] sync_addresses(): (eth0): ignoring IPv6 link-local address
      Oct 18 18:35:01 wrath NetworkManager[12390]: <info> Policy set 'Wired connection 1' (eth0) as default for IPv4 routing and DNS.
      Oct 18 18:35:01 wrath NetworkManager[12390]: <info> Activation (eth0) Stage 5 of 5 (IPv6 Commit) complete.
      Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656335] [nm-ip6-manager.c:1041] netlink_notification(): netlink notificate type 21
      Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656345] [nm-ip6-manager.c:542] process_addr(): processing netlink new/del address message
      Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656359] [nm-ip6-manager.c:1069] netlink_notification(): (eth0): syncing device with netlink changes
      Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656367] [nm-ip6-manager.c:419] nm_ip6_device_sync_from_netlink(): (eth0): syncing with netlink (ra_flags 0x800000B0) (state/target 'got-address'/'got-address')
      Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656376] [nm-ip6-manager.c:438] nm_ip6_device_sync_from_netlink(): (eth0): netlink address: fe80::230:1bff:febc:7f23
      Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656382] [nm-ip6-manager.c:460] nm_ip6_device_sync_from_netlink(): (eth0): addresses synced (state got-address)
      Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656388] [nm-ip6-manager.c:474] nm_ip6_device_sync_from_netlink(): router advertisement requests parallel DHCPv6
      Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656393] [nm-ip6-manager.c:512] nm_ip6_device_sync_from_netlink(): (eth0): RA-provided address no longer valid
      Oct 18 18:35:01 wrath NetworkManager[12390]: <info> (eth0): DHCPv6 client pid 13782 exited with status 0
      Oct 18 18:35:01 wrath NetworkManager[12390]: <debug> [1318955701.656448] [nm-device.c:1582] dhcp6_state_changed(): (eth0): new DHCPv6 client state 23
      Oct 18 18:35:01 wrath NetworkManager[12390]: <info> (eth0): device state change: activated -> failed (reason 'ip-config-unavailable') [100 120 5]
      8434f3b3
    • Dan Williams's avatar
      core: decouple initial IP configuration states from device state · 3927ccd1
      Dan Williams authored
      Initial IP configuration can happen during ACTIVATED state if both
      v4 and v6 are enabled, but one takes longer than the other.  Thus
      various checks throughout the code for IP_CONFIG were incorrect
      since they depended on IP configuration only happening during the
      IP_CONFIG state.  Fix that by using a separate state for IP config
      and using that state for various checks instead of the overall
      device state.
      3927ccd1
    • Dan Williams's avatar
      core: kill stage4 (IP Config Get) · bdd556fe
      Dan Williams authored
      It was somewhat pointless since the IP config is always known when
      stage4 gets scheduled, so why not just pass the config to stage5
      immediately?  Also helps consolidate the v4/v6 failure handling
      logic and makes the operational flow clearer where both v4 and
      v6 are active and proceeding in parallel.
      bdd556fe
    • Dan Williams's avatar
      core: remove unused 'config' parameter from IP timeout methods · 22d72483
      Dan Williams authored
      Long ago used to create an IPv4 LL config when DHCP failed, but
      we don't do that anymore, and it should be done differently anyway.
      22d72483
    • Dan Williams's avatar
      core: remove unused prototype · 31c09eea
      Dan Williams authored
      31c09eea
    • Dan Williams's avatar
      d90f0e18
    • Dan Williams's avatar
      core: more DHCPv6 code shuffle · 7050e690
      Dan Williams authored
      No functional changes.
      7050e690
    • Dan Williams's avatar
    • Dan Williams's avatar
      core: move some more code around · c8217022
      Dan Williams authored
      No functional changes.
      c8217022
    • Dan Williams's avatar
      core: move some code around · e8bbcca3
      Dan Williams authored
      No functional changes, but prepare for splitting DHCPv4 and DHCPv6
      code apart.
      e8bbcca3
    • Mathieu Trudel-Lapierre's avatar
      device: allow for applying IPv4 and IPv6 settings in parallel · d5eee911
      Mathieu Trudel-Lapierre authored
      We don't really need to wait before both IPv4 and IPv6 are established before
      applying all the settings to the device. Instead, we can apply each separately
      when they are ready, which will bring up the interface sooner.
      d5eee911
    • Dan Williams's avatar
      wifi: check whether driver supports AP mode (nl80211 only) · e9d99883
      Dan Williams authored
      For future use of wpa_supplicant's lightweight AP mode instead
      of using Ad-Hoc for hotspot stuff.
      e9d99883
    • Dan Williams's avatar
      nl80211: use floats for signal quality calculations · 8faa032a
      Dan Williams authored
      Since we're working with numbers less than one but greater than
      zero, we need floats.  Otherwise stuff just gets clipped.
      8faa032a
    • Dan Williams's avatar
      build: check for nl80211.h too · 3f39e6a9
      Dan Williams authored
      3f39e6a9
    • Dan Williams's avatar
      wifi: simplify nl80211 bitrate reporting · 779c1e43
      Dan Williams authored
      779c1e43
    • Dan Williams's avatar