Commit Graph

7207 Commits

Author SHA1 Message Date
Jiří Klimeš
9f75f91f3a wired: emit Speed value in PropertiesChanged signal, when changed (bgo #667091)
Speed is gotten via ethtool on 'carrier on' event. If there is a more suitable
netlink event we should use it instead. Nonetheless, it appears to be working
fine with carrier change, because interface speed change does emit carrier offi
and on events.
2012-01-17 14:30:45 +01:00
Dan Williams
a24b9b5299 core: ignore errors when replacing a default route that already exists
If  the route already exists and the kernel tells us that, we
don't need to do anything.  We certainly don't need to warn
about it in the logs.

There was a typo in the IPv6 default route replace function that
ignored a returned error, and thus we didn't suppress the NLE_EXIST
error like we wanted to.  Do the same for the IPv4 default route
while we're at it.
2012-01-16 10:27:21 -06:00
Dan Williams
c4758ef30e core: let callers do error logging for nm_netlink_route_add()
Callers of this function have a better idea of they want to
log errors or not.  Let them handle it, since they already
do, and having a warning here was causing duplicate log
messages.
2012-01-16 10:26:01 -06:00
Jiří Klimeš
aed37465be ppp: change handling of lcp-echo-failure and lcp-echo-interval (bgo #663970)
Don't set default values for the properties, which didn't allow users to
switch off sending echo-request packets. Rather set defaults in editor
or while completing connection for modems.
2012-01-16 09:52:48 +01:00
Dan Williams
1713d3791b core: use default config file path if none was found or given on the command-line 2012-01-13 16:51:04 -06:00
Dan Williams
644e245c0b keyfile: crash less if conf_file is NULL
If for some reason we have no config file, don't segfault.
2012-01-13 16:42:58 -06:00
Colin Walters
8c6d3040dc keyfile: fix mismatched strdup/g_free
g_strdup is also NULL safe.
2012-01-13 00:34:23 -06:00
Colin Walters
0b30200e4b backends: further flesh out "generic" target to build
By default let's assume we don't have to do some magical invocation
to unbreak the libc resolv.conf cache.
2012-01-10 12:13:20 -06:00
Colin Walters
dab7dfaf35 build: fix srcdir != builddir
nm-version.h is in ${top_builddir}/include.
2012-01-09 14:20:36 -06:00
Peter Korsgaard
cbf72aeb34 core: only include execinfo.h if crashtrace support is enabled
On systems without backtrace suport (E.G. uClibc depending on config),
execinfo.h might not be available, breaking the build.

Fix it by only including it if enabled.

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
2012-01-05 11:50:28 -06:00
Dan Williams
5f15918817 core: expose supplicant credentials request/reply functionality
Let the NMDevice listen for credentials requests and reply to them.
2011-12-19 19:47:43 -06:00
Dan Williams
2726c23c54 wifi: detect whether supplicant supports credentials requests
We'll use this to request identity and passwords in-band during
the connection attempt instead of sending them all at the
beginning.  This should allow better handling of wrong
passwords (since we'll know we need to request them from the
user interactively) and better error codes when things fail.
2011-12-19 17:21:41 -06:00
Dan Williams
6b31828f18 core: handle N900 USB network interface again
839c7909 made NM ignore this interface based on faulty
information about what the interface did.  It's actually
just a normal network interface that the N900 can use
to talk to the host or whatever.  It's a bit annoying
that for the most part it won't be used and that NM will
keep attempting to connect it with DHCP unless the user
changes the connection to be static IP (N900 defaults to
address 192.168.2.15 and expects the computer to be
192.168.2.14 and requires an ifup in it's Xterm app) but
if you have an N900 you're probably more knowledgable
than most.

http://wiki.maemo.org/N900_USB_networking
2011-12-15 13:36:29 -06:00
Dan Williams
ff53b383f7 ifupdown: clean up IPv4/IPv6 parsing and fix some memleaks 2011-12-12 21:30:46 -06:00
Guido Günther
2c83670ed7 ifupdown: add support for ipv6 connections 2011-12-12 20:13:13 -06:00
Guido Günther
72bef29d5d ifupdown: add ifparser_haskey function 2011-12-12 20:10:36 -06:00
Guido Günther
92a3bc9e4c ifupdown: cleanup indentation
and remove unused variables.
2011-12-12 20:09:16 -06:00
Dan Williams
80852aa96a ifnet: make testcases happy
ifnet_plugin_get_conf_file() needs to be defined for the testcases.
2011-12-12 20:07:54 -06:00
Dan Williams
1d0c27590e ifnet: use SYSCONFDIR not /etc 2011-12-12 20:04:25 -06:00
Dan Williams
c579bf95a5 trivial: spacing fixes 2011-12-12 20:02:56 -06:00
Mu Qiao
6d09316b6f ifnet: support writing openrc style 2011-12-12 20:02:00 -06:00
Mu Qiao
76619e4529 ifnet: support reading openrc style
IP configuration like 192.168.1.{2..4} is not supported anymore.
2011-12-12 19:44:03 -06:00
Dan Williams
7735b8d72f dbus: rename conf file to match current conventions 2011-12-12 19:31:11 -06:00
Dan Williams
f03b0ac176 bluetooth: ignore "No such adapter" warnings when bluetooth is inactive 2011-12-12 14:06:22 -06:00
Dan Williams
a868fd5a98 core: don't flush routes/addresses on invalid interface indexes
The NM 'iface' isn't always the IP iface (like for modems) so
to avoid a warning, only flush routes and addresses on deactivate
when the iface can actually handle it.
2011-12-12 14:01:21 -06:00
Dan Williams
f6f8ff1c33 wifi: kill wireless-helper.h
Only used in wifi-utils-wext.c now.
2011-12-12 11:45:54 -06:00
Dan Williams
fbd5c5b0e8 wifi: remove unused wpa.c
With the move to the new wpa_supplicant interface we no longer
have to parse the WPA/RSN IEs ourself.
2011-12-12 11:45:54 -06:00
Thomas Graf
29c9abffa3 bonding: auto activate slaves when a master enters prepare state
Reset the auto retries of all slave connections when their master
connection enter prepare state and schedule all of the slaves
for activation if not pending yet.

Slaves are initially scheduled for activation together with their
master but depending on how long it takes for the master
connection to appear the slave activation requests may already
have run out of attempts. Resetting the retries counter ensures
that all slaves are properly activated when a master is brought up.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-09 00:00:36 -06:00
Dan Williams
fcc441622a core: add generic queued state transitions
There are now three places we need delayed state transitions:

1) unavailable to disconnected
2) failed to disconnected
3) bond unavailable to disconnected

(3) wasn't doing a delayed transition, but we can't change
state from inside a state-change handler otherwise we may not
end up fully processing the current state chagne.  So it needs a
delayed transition too; add some generic code to make that
easier to do.
2011-12-08 11:46:58 -06:00
Thomas Graf
cd0058baa7 bonding: move bonding master state to UNAVAILABLE regardless of carrier state
The carrier of a bonding device is the sum of the carrier state of
all its slaves. The carrier is always off if no slaves have been
attached to the master yet.

Therefore the carrier state is of no interest when making a bonding
connection available but we still want to use carrier detection to
move the connection out of ACTIVATED if the carrier of all slaves
are off.

A neat solution is to always put the bonding master directly into
DISCONNECTED whenever its state is changed to UNAVAILABLE.

This will make a bonding master available for activation immediately
and move it to DISCONNECTED whenever all slaves have been without
a carrier for 4 seconds.

In the future, the move from UNAVAILABLE to DISCONNECTED may be made
dependant on the availability of at least one configured slave.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-08 10:35:49 -06:00
Thomas Graf
916631f15a bonding: abort activation of unknown slave types
Abort activation of slaves which are unknown and log successful
enslave/release.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-08 10:34:35 -06:00
Thomas Graf
200a7e142a wired: allow devices to be reassumed when ip4 config is disabled
Wired connections acting as bonding slave will have their ip4
config disabled. Allow such connections to reassume devices.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-08 10:33:21 -06:00
Thomas Graf
40164fbc1f ethernet: move all connection <-> device matching into a single function
Moves all code to match an ethernet connection into a single function
match_ethernet_connection() and use it from everywhere within
NMDeviceEthernet.

Use of match_ethernet_connection() in connection_match_config() enables
bondig connections to be successfully matched with configurations with
matching interface names.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-08 10:32:51 -06:00
Thomas Graf
3bdd2d7429 ethernet: check kernel interface binding when matching config
When matching an ethernet device with connection settings, check if
the connection needs to be bound to a specific virtual kernel interface.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-08 10:12:29 -06:00
Thomas Graf
1cd8d52061 bonding: add nm_connection_get_virtual_iface_name() to abstract kernel interface binding
Some connection types such as bonding, bridging and VLAN require
specific virtual kernel interfaces identified by name to be auto
connected to the connection.

The function nm_connection_get_virtual_iface_name() returns the name
of the kernel interface if the connection type requires this
functionatlity.

Each connection base type settings class can implement the function
get_virtual_iface_name() if the connection needs to be auto connected
to a specific kernel interface.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-08 09:56:47 -06:00
Guido Günther
6dcd9114cb ifupdown: add testcase to verify parsing into NMConnection 2011-12-07 17:58:44 -06:00
Guido Günther
e4fbf5363e ifupdown: support dns-search entries
as used by resolvconf and openresolv.
2011-12-07 17:58:24 -06:00
Jiří Klimeš
fdec6acff3 trivial: fix comment 2011-12-07 10:42:17 +01:00
Dan Williams
dff0d2a189 core: ensure correct IP family completion is scheduled
The callers of fw_add_to_zone() were passing an 'int' (AF_INET or
AF_INET6) while that function was expecting a boolean.  Thus when
IPv6 functions passed AF_INET6 that would be interpreted as TRUE
and IPv4 operations would be scheduled.
2011-12-06 17:31:46 -06:00
Dan Williams
768d54bcc6 core: use right IP family when commiting IP configuration
IPv6 needs to clear it's own activation chain, not IPv4's.
2011-12-06 17:17:34 -06:00
Dan Williams
469b263043 core: better failure handling when starting IP configuration
First, log when there's an unhandled IP config method, and
second, assume failure in IPv4 configs.  IPv6 already did.
2011-12-06 17:00:40 -06:00
Dan Williams
b2eaf7228e firewall: add firewall log domain and use it in firewall code 2011-12-06 16:51:17 -06:00
Dan Williams
4fd510cbcd trivial: move some log messages earlier
Would have been helpful to more easily catch a bug cyphermox and
I were discussion on IRC.
2011-12-06 16:36:37 -06:00
Dan Williams
ce9d8a68d7 policy: recheck activation after connection retries are cleared
After any connection has had its retries cleared, schedule an
activation check so that we can possibly use that connection
again.
2011-12-06 16:33:00 -06:00
Thomas Graf
18088e0d07 trivial: add nm_device_get_connection()
Shortcut to access the connection linked to the activation
request of a device.

The patch only replaces usage with nm_device_get_connection()
if the existing code assumes that an activation request must
be available.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-06 16:10:23 -06:00
Thomas Graf
86d5a40677 libnm-util: add nm_connection_get_setting_serial()
Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-06 16:08:39 -06:00
Thomas Graf
5b7503e95e core: use nm_connection_get_setting_<type>() whenever possible
Leads to shorter, easier to read code and improves type casting safety.

Signed-off-by: Thomas Graf <tgraf@redhat.com>
2011-12-06 16:06:43 -06:00
Dan Williams
c1344ec097 trivial: small cleanup checking error 2011-12-05 12:14:40 -06:00
Dan Williams
2ade420479 netlink: consolidate netlink monitor error handling and initialization
The fact that any of this code was in main.c was a hangover from
a long time ago and it should really go with the rest of the
netlink monitor code.
2011-12-03 17:38:07 -06:00
Dan Williams
33ae7cf518 trivial: fix comment 2011-12-03 15:33:18 -06:00