Hi Samuel,

following patches allow connman to support IPv6 only networks.
This means that if IPv4 is turned off (ipconfig method is OFF) or
dhcp does not return any IPv4 address and IPv6 is set to auto,
then service can be connected if interface has IPv6 address.
The user can set the IPv6 to OFF if the IPv6 addressing should not
make the service ready.

In practice this means that following is possible:

$ ./list-services
[ /profile/default/ethernet_0050dacfd855_cable ]
    IPv6.Configuration = { Method=auto }
    IPv6 = { PrefixLength=64 Method=auto 
Address=2001:db8:200:2:250:daff:fecf:d855 }
    IPv4.Configuration = { Method=dhcp }
    IPv4 = { Netmask=255.255.255.0 Gateway=192.168.1.1 Method=dhcp 
Address=192.168.1.100 }
$ ./get-state
System is online
$ ./set-ipv4-method ethernet_0050dacfd855_cable off
Setting method off for ethernet_0050dacfd855_cable
New IPv4.Configuration:  {'Method': 'off'}

$ ./get-state
System is online
$ ./list-services
[ /profile/default/ethernet_0050dacfd855_cable ]
    IPv6.Configuration = { Method=auto }
    IPv6 = { PrefixLength=64 Method=auto 
Address=2001:db8:200:2:250:daff:fecf:d855 }
    IPv4.Configuration = { Method=off }
    IPv4 = { }
$ ./set-ipv6-method ethernet_0050dacfd855_cable off
Setting method off for ethernet_0050dacfd855_cable
New IPv6.Configuration:  {'Method': 'off'}

$ ./get-state
System is offline
$ ./list-services
[ /profile/default/ethernet_0050dacfd855_cable ]
    IPv6.Configuration = { Method=off }
    IPv6 = { }
    IPv4.Configuration = { Method=off }
    IPv4 = { }
$ ./set-ipv6-method ethernet_0050dacfd855_cable auto
Setting method auto for ethernet_0050dacfd855_cable
New IPv6.Configuration:  {'Method': 'auto'}

$ ./list-services
[ /profile/default/ethernet_0050dacfd855_cable ]
    IPv6.Configuration = { Method=auto }
    IPv6 = { PrefixLength=64 Method=auto 
Address=2001:db8:200:2:250:daff:fecf:d855 }
    IPv4.Configuration = { Method=off }
    IPv4 = { }
$ ./get-state
System is online
$ ./set-ipv4-method ethernet_0050dacfd855_cable dhcp
Setting method dhcp for ethernet_0050dacfd855_cable
New IPv4.Configuration:  {'Method': 'dhcp'}

$ ./list-services
[ /profile/default/ethernet_0050dacfd855_cable ]
    IPv6.Configuration = { Method=auto }
    IPv6 = { PrefixLength=64 Method=auto 
Address=2001:db8:200:2:250:daff:fecf:d855 }
    IPv4.Configuration = { Method=dhcp }
    IPv4 = { Netmask=255.255.255.0 Gateway=192.168.1.1 Method=dhcp 
Address=192.168.1.100 }
$ ./get-state
System is online
$ ./set-ipv6-method ethernet_0050dacfd855_cable off
Setting method off for ethernet_0050dacfd855_cable
New IPv6.Configuration:  {'Method': 'off'}

$ ./get-state
System is online
$ ./set-ipv4-method ethernet_0050dacfd855_cable off
Setting method off for ethernet_0050dacfd855_cable
New IPv4.Configuration:  {'Method': 'off'}

$ ./get-state
System is offline


Then the patches:

01: This is the patch that we talked in the mailing list earlier,
    it just clears the pointers in ipaddress struct instead of
    just freeing the pointers. This should not make much difference
    and I did not see any problems with the original version.

02: Nameserver property for IPv6, this is needed by patch #07

03: Helper function for getting the ipconfig type, needed by
    patches #09 and #10

04: Split the service state for two parts, the other one is
    handling IPv4 state and the other IPv6 state. The states
    are combined by combine_state(). The system should still
    behave the same way after this patch i.e., IPv4 state is
    the master state.

05: Enable or disable IPv6 when the loading the config from
    file.

06: Determine the service state from IPv4 and IPv6 states.

07: Enable IPv6 autoconf to change the state. This is the network
    part.

08: Set the service state correctly when network is disconnected.

09: Set the service state correctly when ipconfig is cleared.

10: IPv6 autoconf will change the service state. The autoconf
    address creation/deletion is received via netlink which then
    calls service bound and release functions. Note that in
    bound case, the ipconfig is not enabled because that call
    is done already. The ipconfig disable needs to be done in
    release case as it would not be done otherwise.

11: Check and change the state properly if the user changes
    ipconfig method.

12: Disable IPv4 when address is released and IPv4 is marked OFF.

13: If loading IPv6 which is autoconfigurable, then update the
    service state.

14: Remove the IPv6 from todo list as the most important stuff
    is now implemented.

>From these patches the #01, #02 and #03 and also perhaps #04 are
independent. The other ones should be commited in one go.


Regards,
Jukka



Jukka Rissanen (14):
  ipconfig: Clear the ipaddress pointers when address is deleted.
  ipv6: Add property for IPv6 nameserver
  ipconfig: Added helper function that returns the config type.
  service: Split service state to IPv4 and IPv6 parts.
  ipconfig: Enable or disable IPv6 when loading the saved service.
  service: Only disconnect the service if both IPv4 and IPv6 states
    agree.
  network: Enable IPv6 autoconf to change the service state to ready.
  service: Set service state correctly when network is disconnected.
  service: Set service state correctly when ipconfig is cleared.
  service: IPv6 autoconf will change the service state.
  service: Check service state properly if user changes method.
  service: Disable IPv4 when address is released and IPv4 is marked OFF.
  ipconfig: Enable ipconfig if loading autoconfigurable IPv6 config.
  todo: Remove IPv6 enhancements as they are implemented.

 TODO               |   13 --
 include/property.h |    1 +
 src/connection.c   |    6 +-
 src/connman.h      |    5 +-
 src/ipconfig.c     |   30 ++++-
 src/location.c     |    3 +-
 src/network.c      |   68 ++++++++-
 src/provider.c     |   27 +++-
 src/service.c      |  414 +++++++++++++++++++++++++++++++++++++++++++---------
 9 files changed, 461 insertions(+), 106 deletions(-)

_______________________________________________
connman mailing list
connman@connman.net
http://lists.connman.net/listinfo/connman

Reply via email to