Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[connman] quick fix to make connections work again. #4

Merged
merged 1 commit into from Sep 24, 2013
Merged

[connman] quick fix to make connections work again. #4

merged 1 commit into from Sep 24, 2013

Conversation

lpotter
Copy link
Contributor

@lpotter lpotter commented Sep 24, 2013

TODO: fix this

stskeeps added a commit that referenced this pull request Sep 24, 2013
[connman] quick fix to make connections work again.
@stskeeps stskeeps merged commit c983c88 into mer-packages:master Sep 24, 2013
@stskeeps
Copy link
Contributor

OK, but this needs to be fixed properly

lpotter pushed a commit that referenced this pull request May 3, 2014
In order to recover from a lost lease, gdhcp will restart the address
acquisition process. As the dhcp structures are removed from the hash
and freed in dhcp_invalidate() without notifying gdhcp, the following
happens:

connmand[28337]: DHCP index 3: lease expired
connmand[28337]: DHCP index 3: restart DHCP (retries 0)
connmand[28337]: DHCP index 3: DHCP client start with state init_reboot
connmand[28337]: DHCP index 3: sending DHCP request
connmand[28337]: src/dhcp.c:lease_lost_cb() Lease lost
connmand[28337]: src/dhcp.c:dhcp_invalidate() dhcp 0xb958a0 callback 1
connmand[28337]: src/dhcp.c:dhcp_invalidate() last address 10.0.0.18
connmand[28337]: src/dhcp.c:__connman_dhcp_stop() network_table 0xb94c60 network 0xb9b500
connmand[28337]: wlan0 {del} address 10.0.0.18/20 label wlan0
connmand[28337]: wlan0 {del} route 10.0.0.0 gw 0.0.0.0 scope 253 <LINK>
connmand[28337]: DHCP index 3: received DHCP packet xid 0x0000 (current state 1)
connmand[28337]: DHCP index 3: switch listening mode (1 ==> 0)
connmand[28337]: src/dhcp.c:lease_available_cb() Lease available
connmand[28337]: Aborting (signal 11) [src/connmand]
connmand[28337]: ++++++++ backtrace ++++++++
connmand[28337]: #0  0x7f1890e98420 in /lib/x86_64-linux-gnu/libc.so.6
connmand[28337]: #1  0x439580 in connman_device_get_ident() at src/device.c:555
connmand[28337]: #2  0x448041 in connman_service_lookup_from_network() at src/service.c:6483
connmand[28337]: #3  0x459d97 in lease_available_cb() at src/dhcp.c:331
connmand[28337]: #4  0x4122b1 in start_bound() at gdhcp/client.c:1740
connmand[28337]: #5  0x7f1891f8a526 in /lib/x86_64-linux-gnu/libglib-2.0.so.0
connmand[28337]: #6  0x7f1891f8a878 in /lib/x86_64-linux-gnu/libglib-2.0.so.0
connmand[28337]: #7  0x7f1891f8ab3a in /lib/x86_64-linux-gnu/libglib-2.0.so.0
connmand[28337]: #8  0x40f902 in main() at src/main.c:690
connmand[28337]: #9  0x7f1890e84b45 in /lib/x86_64-linux-gnu/libc.so.6
connmand[28337]: +++++++++++++++++++++++++++

Fix this by freeing and removing the dhcp structure only when calling
__connman_dhcp_stop() and modify dhcp_invalidate() so that it only
resets IP configuration data for the service.

This also fixes the reference counting issue reported by Eduardo
Abinader.
tigeli pushed a commit that referenced this pull request Aug 13, 2014
Sometimes while switching network dhcp_initialize() fails because
interface is not up and hence dhcp->dhcp_client remains NULL. Here we
don't check return type of dhcp_initialize() and go on to call function
g_dhcp_client_start() and crash occurs.

Below trace is obtained when connman crashes:
connmand[19034]: Aborting (signal 11) [/usr/local/sbin/connmand]
connmand[19034]: ++++++++ backtrace ++++++++
connmand[19034]: #0  0xb7630f38 in /lib/i386-linux-gnu/libpthread.so.0
connmand[19034]: #1  0x8055a22 in debug() at client.c:0
connmand[19034]: #2  0x8058837 in g_dhcp_client_start() at polkit.c:0
connmand[19034]: #3  0x80a4772 in __connman_dhcp_start() at polkit.c:0
connmand[19034]: #4  0x8082a80 in set_connected.part.8() at network.c:0
connmand[19034]: #5  0x8082f7f in connman_network_set_connected() at
??:0
connmand[19034]: #6  0x805f921 in eth_network_connect() at ethernet.c:0
connmand[19034]: #7  0x8082dc3 in __connman_network_connect() at
polkit.c:0
connmand[19034]: #8  0x808e7e4 in __connman_service_connect() at
polkit.c:0
connmand[19034]: #9  0x808eef0 in auto_connect_service() at service.c:0
connmand[19034]: #10 0x808efde in run_auto_connect() at service.c:0
connmand[19034]: #11 0xb76cea3f in /lib/i386-linux-gnu/libglib-2.0.so.0
connmand[19034]: #12 0xb76cdd46 in /lib/i386-linux-gnu/libglib-2.0.so.0
connmand[19034]: #13 0xb76ce0e5 in /lib/i386-linux-gnu/libglib-2.0.so.0
connmand[19034]: #14 0xb76ce52b in /lib/i386-linux-gnu/libglib-2.0.so.0
connmand[19034]: #15 0x80544cd in main() at polkit.c:0
connmand[19034]: #16 0xb739b4d3 in /lib/i386-linux-gnu/libc.so.6
connmand[19034]: +++++++++++++++++++++++++++
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants