summaryrefslogtreecommitdiff
path: root/src/connection.c
AgeCommit message (Collapse)AuthorFilesLines
2012-08-15connection: Disconnect VPN when underlaying service disconnectsJukka Rissanen1-41/+63
Fixes BMC#25128
2012-08-09connection: Set VPN default route to the VPN interfaceJukka Rissanen1-16/+4
Do not bother setting individual routes for default gateway so for VPN we set the whole interface as a default gateway route.
2012-08-09connection: Add more debugging when setting VPN routesJukka Rissanen1-0/+7
2012-05-18connection: Refactor VPN route setupJukka Rissanen1-64/+72
2012-05-08connection: Fix possible NULL dereferenceAdrien Bustany1-15/+19
2012-05-08connection: Fix host route to VPN serverDaniel Wagner1-2/+13
The kernel will ignore host routes which are bogus. In case of a PtP connection such as PPP for cellular the gateway address should not be used.
2012-05-02connection: Set host route to VPN serverJukka Rissanen1-8/+24
This is needed so that we can access hosts behind the VPN. The route might already be setup if VPN server is the same as nameserver or similar.
2012-04-29core: Update copyright informationMarcel Holtmann1-1/+1
2012-04-12provider: Disconnect VPN when phy service is disconnectedJukka Rissanen1-0/+22
If the VPN is connected and the underlaying service is disconnected, then we must also disconnect the VPN if it is still connected.
2012-04-05connection: Add host route for VPN when setting default gatewayJukka Rissanen1-0/+4
This is needed so that VPN gets default route when moving services. That can happen if VPN did not had default route before.
2012-04-05connection: Remove wrong VPN routeJukka Rissanen1-10/+22
Before this patch the system created following routes for VPN Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.10.9 0.0.0.0 UG 0 0 0 vpn0 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0 192.168.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 vpn0 192.168.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 wlan0 192.168.10.1 192.168.10.9 255.255.255.255 UGH 0 0 0 vpn0 192.168.10.9 0.0.0.0 255.255.255.255 UH 0 0 0 vpn0 Here the route to gateway in wlan0 192.168.2.1 via vpn0 is not correct and it will prevent connections to 192.168.2.1 The correct routes should be: Destination Gateway Genmask Flags Metric Ref Use Iface 0.0.0.0 192.168.10.9 0.0.0.0 UG 0 0 0 vpn0 192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0 192.168.2.1 0.0.0.0 255.255.255.255 UH 0 0 0 wlan0 192.168.10.1 192.168.10.9 255.255.255.255 UGH 0 0 0 vpn0 192.168.10.9 0.0.0.0 255.255.255.255 UH 0 0 0 vpn0 Fixes MBC#25035
2012-04-05connection: Set additional point-to-point routeJukka Rissanen1-16/+40
This is useful if P-t-P link does not have a default route. Fixes BMC#25027
2012-04-05connection: Remove original default route only when neededJukka Rissanen1-2/+8
If the new VPN gateway has split routing set, then do not clear original default route because VPN will not set the default route. Without this check we would not get any proper default route set.
2012-04-05connection: Update service list orderJukka Rissanen1-0/+2
This is done as we might have changed the order of the services so force update of the service list.
2012-03-19connection: Try to avoid having two default gatewaysJukka Rissanen1-13/+131
It is possible that because the rtnl messages arrive asynchronously, we might end up having two default gateways that are both active at the same time. If that happens, we try to downgrade the one that is not yet active.
2012-03-19connection: Remove obsolete routes for VPNJukka Rissanen1-6/+0
2012-03-19connection: Check all active gateways in updateJukka Rissanen1-17/+34
There can be multiple active gateways in the system at the same time so we must check them all when updating gateway info.
2012-03-19connection: Get correct VPN phy link dataJukka Rissanen1-56/+93
VPN could be using wrong phy link data if there are multiple active links.
2012-03-19connection: Do not set host routes in VPN caseJukka Rissanen1-17/+0
These routes are not needed.
2012-03-19connection: Avoid stale memory accessJukka Rissanen1-1/+2
Get the active gateway pointer only after the gateway hash has been manipulated by add_gateway(). It is possible that we are accessing stale pointer otherwise.
2012-03-19service: Allow removing only certain type nameserversJukka Rissanen1-1/+1
When nameserver are removed by __connman_connection_gateway_remove() then remove only certain type nameserver (IPv4 or IPv6). This is needed so that we do not loose IPv4 routes if only IPv6 nameservers are to be removed. This is needed when there are multiple connected services.
2012-03-19connection: Remove nameserver routes only onceJukka Rissanen1-2/+0
2012-03-19connection: Trigger service updates only after setting gatewaysJukka Rissanen1-7/+15
This is needed so that gateways are set properly when service triggers online checks.
2012-03-19connection: Fix debugging printsJukka Rissanen1-3/+40
2012-01-20connection: Only take service ref when saving serviceJukka Rissanen1-9/+5
The fix b68795352dd5a9ac41eab31c765ade0c88329a6e was only partly working. We must only take the ref when we are saving stuff to hash (no need to take ref if we are only modifying value in the hash). This patch reverts the commit b68795
2012-01-13connection: Fix service refcountYu A Wang1-0/+8
Service may be refcount two times when add_gateway for both ipv4 and ipv6, we need to unref the service twice according when we have both ipv6 and ipv4 gateway
2011-12-01service: Recompute service state when moving it upTomasz Bursztyka1-2/+0
It should be possible to move down an online service to ready and the one which goes up might come up online after recomputing its state.
2011-09-12connection: Service was not ref counted properlyJukka Rissanen1-2/+4
The reference counting problems were clearly seen with VPN service.
2011-08-24connection: Default gateway is changed when reorganizing servicesJukka Rissanen1-2/+87
Fixes BMC#22540
2011-08-18connection: Fix IPv6 host route setting when using VPNJukka Rissanen1-1/+2
2011-08-18connection: Fix indentationJukka Rissanen1-4/+4
2011-08-17connection: Fix vpn on networks without gatewayYu A Wang1-2/+33
VPN establishment fails on gateway less networks, like for example ppp based cellular ones. To fix that, a host route to the VPN server is established.
2011-08-16connection: Set proper gateway for ppp linksYu A Wang1-0/+11
The default gateway for ppp connection should be 0.0.0.0 for ipv4 and :: for ipv6. This issue fixed before but removed by the commit 84a739d0082b89efa8cfbf376abe17937e4bc843
2011-07-08network: Let the gateway code handle the READY transitionSamuel Ortiz1-1/+2
For IPv4 (DHCP, fixed or manual), and for manual IPv6, the gateway handling code (connection.c) is the one responsible for moving to the READY state.
2011-07-07service: Use __connman_service_ipconfig_indicate_state()Daniel Wagner1-2/+4
2011-06-27connection: Separate IPv4 and IPv6 gateway and routing handling.Jukka Rissanen1-120/+375
2011-05-31service: Indicate IP Configuration Ready EventGrant Erickson1-2/+1
In the Connection Manager, completion of a valid IP configuration excites the service state machine to move from the "configuration" to the "ready" state. However, the existing implementation of IP configuration completion explicitly attempts to directly manipulate service state, rather than hinting at an excitation event. As a consequence, a late IP configuration completion after the service state machine has transitioned from "ready" to "online" can lead to an incorrect transition back to the "ready" state. This causes the connection count for the technology associated with that service to increment again, unnecessarily. This patch avoids this issue by providing a service object interface that simply hints that an IP configuration is complete for a given IP type, allowing the service object and its state machine to either hold fast in the present state, returning an advisory error or advancing, as before. All prior invocations of __connman_service_indicate_state outside of the service module for the CONNMAN_SERVICE_STATE_READY are replaced with calls to this new interface. Thanks to Daniel Wagner and Marcel Holtmann for offline IRC discussion that helped motivate this fix. * v2: Incorporated feedback from Samuel Ortiz about combining IPv4 and IPv6 states before checking state readiness.
2011-02-25connection: Do not move to DISCONNECT when removing a gatewaySamuel Ortiz1-8/+0
The state change should be handled by the caller.
2011-02-25network: Remove gateway when network disconnectsSamuel Ortiz1-0/+4
2011-02-22connection: Check gateway_hash value before call update_order()Martin Xu1-0/+3
When exit from ConnMan, __connman_connection_cleanup() is called before __connman_service_cleanup() which then calls update_order(). __connman_connection_cleanup() sets gateway_hash as NULL, so update_order() will access NULL hash and causes GLib-CRITICAL abort
2011-02-15connection: Remove connection elementDaniel Wagner1-195/+135
2011-02-11service: Split service state to IPv4 and IPv6 partsJukka Rissanen1-2/+4
2011-01-05memoryleak: IPv6 gateway was not freedJukka Rissanen1-0/+1
2010-12-31memoryleak: remove the element for realJukka Rissanen1-0/+2
2010-12-21connection: Add gateway host routes for non NULL gatewaysSamuel Ortiz1-2/+5
2010-11-03connection: Prefer IPv4 peer over the regular addressSamuel Ortiz1-1/+7
If the peer IPv4 address is set, this will be the gateway address.
2010-08-20Set VPN services as the default onesSamuel Ortiz1-4/+11
With full-tunnel VPNs, the default service should be the VPN one.
2010-07-29Update service domain name when connection becomes activeMarcel Holtmann1-3/+9
2010-07-29Initial IPv6 supportMartin Xu1-4/+20
Only manual/fixed setting supported for now.
2010-07-14change data->gateway to data->ipv4_gateway in src/connection.cMartin Xu1-21/+23