Commit Graph

15047 Commits

Author SHA1 Message Date
Lubomir Rintel
d830841d63 manager: return values for a non-void function
Fixes: d8e1590c50
2015-12-18 12:10:02 +01:00
Lubomir Rintel
d8e1590c50 manager: retry device creation for connection that would use a newly created device
The VLANs (unrealized) can depend on the devices that are not around yet. We
need to retry their creation when the potential parents appear.
2015-12-18 11:32:34 +01:00
Jiří Klimeš
9ec9e4e72a libnm-core/docs: add/fix missing descriptions 2015-12-18 11:16:22 +01:00
Jiří Klimeš
360d5037a4 docs: add missing documentation for settings and devices 2015-12-18 11:05:39 +01:00
Jiří Klimeš
3ca758790e libnm: fix documentation of NMSettingIP6ConfigAddrGenMode values 2015-12-18 10:27:27 +01:00
Thomas Haller
793e985918 rdisc: fix regression in send_rs() (cannot create router solicitation)
Fixes: 21efcfe6b5
2015-12-17 21:26:54 +01:00
Thomas Haller
5aba5685f2 platform: merge branch 'th/platform-no-sync-socket-bgo759490'
https://bugzilla.gnome.org/show_bug.cgi?id=759490
2015-12-17 18:44:43 +01:00
Thomas Haller
c40acf334e core: optimize NMMultiIndex by special caseing ids with one value only
When adding a very first item for a certain id, don't yet create a
hash table but store the first item inplace. This optimizes storage
for the case where we have only one item for a certain id.
2015-12-17 18:42:54 +01:00
Thomas Haller
ad1d74d142 platform: add index for links by ifname
Downsides:

  - Add some additional overhead to manage the index

  - The NMPCacheId struct grows to 16 bytes, affecting
    hashing performance for all object types.

Still do it, based on the assumption that it doesn't matter
for a low number of interfaces. But the O(1) access time matters
when having lots of interfaces.
2015-12-17 18:42:53 +01:00
Thomas Haller
88213b2e6a platform: tighten return value from do_add_addrroute()
Only return TRUE, if the netlink request was responded with success and
the object exists after adding.
2015-12-17 18:42:53 +01:00
Thomas Haller
1a501c6456 platform: check for existing link in do_add_link_with_lookup()
When adding a link, that can only make sense if no such link
exists yet. Check for that condition first, to properly return
an error.
2015-12-17 18:42:53 +01:00
Thomas Haller
cea8f1a0f0 platform: change meaning of return value for delete-function
When deleting an object, we allow failure to delete a non-existing object.
Thus, the only thing we care about is whether the object is no longer
present after deletion. Adjust the return values to reflect that.
2015-12-17 18:42:53 +01:00
Thomas Haller
690732cfed platform: drop delayed_action idle handler
The idea was allowing pending delayed-actions and process them in an
idle handler. We dont want to do that, because whenever platform code
returns, we want to have no pending actions -- because otherwise the
platform cache might be in an inconsistent state.

Just drop it.
2015-12-17 18:42:51 +01:00
Thomas Haller
a29f438294 platform/trivial: rename internal field with netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
412a50bd30 platform: inline event_handler_read_netlink() 2015-12-17 18:42:01 +01:00
Thomas Haller
d7782b9769 platform: drop synchronous netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
c73b9f6529 platform: change links via event netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
1097967077 platform: delete objects via event netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
be28608a8f platform: add addresses and routes via event netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
f8378800bb platform: add links via event netlink socket 2015-12-17 18:42:01 +01:00
Thomas Haller
dce5e6d815 platform: assert that delayed_action_handle_all() is not called recursively
We would not expect that delayed_action_handle_all() is called recursively.
Assert against that. If we ever happen to call it recursively, we would
need to take care of properly avoiding infinite loops or deep call
stacks.
2015-12-17 18:41:59 +01:00
Thomas Haller
6d67e6e9c4 platform: rework waiting for netlink response
Track pending netlink requests and properly report the resulting errno
back.

Currently we send only requests in do_request_link() and do_request_all().
These callers don't actually care about the result, all they care that the
request is answered before returning back from platform code to the caller.
Thus, up to now the tracking of the sequence number was pretty simple.

Later we also want to get the errno from a request, thus rework sending
requests to also remember about outstanding sequence numbers and
properly track muliple parallel requests.

Later the synchronous actions (e.g. add-link) will also be handled
via the asynchronous socket.
2015-12-17 18:32:15 +01:00
Thomas Haller
eb182c2e1c platform: minor refactoring in delayed_action_schedule() 2015-12-17 18:32:09 +01:00
Thomas Haller
c9e04c963e platform: implement our own sequence counter
Instead of using the one from libnl's socket.
2015-12-17 18:32:06 +01:00
Thomas Haller
4ea711e03e platform/trivial: remove obsolete code comment 2015-12-17 18:08:36 +01:00
Thomas Haller
ecdcfda0dd platform: cleanup event_handler_recvmsg() (rename event_valid_msg()) 2015-12-17 18:08:36 +01:00
Thomas Haller
6ee868678b platform: cleanup event_handler_recvmsg() (drop _nl_sock_flush_data())
Also avoids/fixes a bug in _nl_sock_flush_data() where we would loop
endlessly, if nl_recvmsgs() fails for reasons other then EAGAIN.
2015-12-17 18:08:36 +01:00
Thomas Haller
385e68327f platform: cleanup event_handler_recvmsg() (adjust log messages) 2015-12-17 18:08:36 +01:00
Thomas Haller
47773c80ac platform: cleanup event_handler_recvmsg() (inline event_err()) 2015-12-17 18:08:36 +01:00
Thomas Haller
c13163cd55 platform: cleanup event_handler_recvmsg() (move EAGAIN workaround) 2015-12-17 18:08:36 +01:00
Thomas Haller
bdd2c31d39 platform: cleanup event_handler_recvmsg() (inline verify_source()) 2015-12-17 18:08:36 +01:00
Thomas Haller
3e2d0d6968 platform: cleanup event_handler_recvmsg() (code-style) 2015-12-17 18:08:36 +01:00
Thomas Haller
2f6b5d4125 platform: reimplement nl_recvmsg() in platform
Calling nl_recvmsgs_default() leads dirctly to recvmsgs() from
"nl.c". This functions reads messages (recvmsg) in a loop and
invokes the callbacks.

Later we want to merge nlh and nlh_event, meaning that we must
anticipate parsing unrelated messages while waiting for an ACK.
While that would be possible by registering different callbacks
and letting them interact, it is actually more complicated. Just
assume full control over the message parsing.

Basically, copy recvmsgs() to event_handler_recvmsg(). For now just
copy the function and do little adjustment (to show the similarity
to the original). Cleanup follows.
2015-12-17 18:08:36 +01:00
Thomas Haller
be0f8e2854 platform/trivial: move code
sysctl handling is independent from netlink-cache. Move the code.
2015-12-17 18:08:36 +01:00
Thomas Haller
21efcfe6b5 rdisc: downgrade logging severity and rate-limit logging for sending router solicitation
Downgrade the severity for failure to send router solicitations
to WARN level. Also, repeated (identical) lines will be further
downgraded to DEBUG level.

Also pass the error reason to the caller and combine the message with
the "sending router solicitation" message.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=775736
https://bugzilla.redhat.com/show_bug.cgi?id=1034443
https://bugzilla.redhat.com/show_bug.cgi?id=1010540
https://lists.launchpad.net/touch-packages/msg75697.html

https://bugzilla.gnome.org/show_bug.cgi?id=759596
2015-12-17 17:28:49 +01:00
Thomas Haller
444df2d30e rdisc: don't log error message when failing to create NDP socket
Let the caller do that, he already logs an ERR level message. Just
combine the messages.
2015-12-17 17:28:48 +01:00
Thomas Haller
b9a3b780c2 rdisc: refactor to use nm_clear_source() 2015-12-17 17:28:48 +01:00
Jiří Klimeš
73dcc3310c cli: (bash completion): add new settings to completion of '--fields' 2015-12-17 16:42:54 +01:00
Jiří Klimeš
6391a20114 cli: add bash completion for arguments of tun, ip-tunnel, macvlan, vxlan
for 'nmcli connection add type ...'
2015-12-17 16:28:42 +01:00
Jiří Klimeš
016db38ce2 cli: use '|' instead of ',' for delimiting the modes
to be consistent with other options
2015-12-17 16:20:10 +01:00
Jiří Klimeš
81dcf9b218 cli: really fix the description this time
Fixes: 3a6cd8204f
2015-12-17 16:10:32 +01:00
Thomas Haller
4878516281 trivial: fix indention/whitespace 2015-12-17 15:39:24 +01:00
Lubomir Rintel
a6ceb382e9 device: connect slave assumption recheck on external enslavement
The nm_device_master_add_slave() also modifies slave's master property which
impacts the ability to enslave. When called in reaction to external
master property change we now no longer call enslave_slave which used to queue
the recheck previously:

  # nmcli c add type bridge ifname br0
  # ip link add dummy0 type dummy
  # ip link set dummy0 up
  # ip link set dummy0 master br0  # We should recheck for assumed connection
                                   # here, since dummy0 can now be assumed.
2015-12-17 15:37:01 +01:00
Thomas Haller
0959109b19 cli: fix spelling in user visible texts
https://bugzilla.gnome.org/show_bug.cgi?id=759555

Reported-by: Anders Jonsson <anders.jonsson@norsjovallen.se>
2015-12-17 12:25:26 +01:00
Piotr Drąg
d612cccc4f po: update Polish (pl) translation (bgo #759562)
https://bugzilla.gnome.org/show_bug.cgi?id=759562
2015-12-17 12:17:27 +01:00
Lubomir Rintel
2e22880894 device: don't remove the device from master if its link has no master
We only need to do that when we're replacing the master with a different
one. Just after the link creation is has no master and we'd remove it
from the master device here.
2015-12-16 18:53:27 +01:00
Beniamino Galvani
88f3aba9bf platform/tests: always run link tests using both methods
Randomly choosing one between the two link creation methods (platform
and external) makes it more difficult to immediately detect when a bug
in introduced. Always execute them using both methods to have a better
code coverage, but still try a third time with a random one to test
different combinations of methods.
2015-12-16 17:02:08 +01:00
Dan Williams
35c1c45bc4 merge: fix various crashes and issues with ADSL devices (bgo #759001) 2015-12-16 09:21:39 -06:00
Dan Williams
9bb96b00a5 adsl: look up ATM index before construction
Fixes a crash if we can't read the ATM index.  We need the ATM
index, and we can't do anything with the device before we have it,
so don't bother creating one if we we can't get it.

NetworkManager[9662]: <error> [1449678770.705541] [nm-device-adsl.c:607] constructor(): (atmtcp0): error reading ATM device index

(NetworkManager:9662): GLib-GObject-CRITICAL **: object NMDeviceAdsl 0x1e8f880 finalized while still in-construction

(NetworkManager:9662): GLib-GObject-CRITICAL **: Custom constructor for class NMDeviceAdsl returned NULL (which is invalid). Please use GInitable instead.
**
NetworkManager-adsl:ERROR:nm-atm-manager.c:121:adsl_add: assertion failed: (device)
2015-12-16 09:18:11 -06:00
Dan Williams
29f4de09a5 adsl: fix detection of br2684 ("nas") interface (bgo #759001)
At some point the platform changed to no longer ask the kernel for
interfaces when one wasn't in its cache, but to wait for netlink
events to be notified of the new interface.  That broke some assumptions
that the ADSL code was making, causing a crash.

Rework the ADSL br2684 interface to clean up a couple of things
(get rid of 'disposed', consolidate dispose/deactivate cleanup) and
watch for the br2684 interface to show up with a periodic timeout.
2015-12-16 09:18:11 -06:00