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.
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.
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.
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.
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>
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.
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
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.
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>
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.
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>
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>
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>
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>
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>
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.
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>