Re: [PATCH] Initial IPv6 support



On Mon, 2008-06-23 at 14:22 -1000, David Cantrell wrote:
> Attached is a patch to libnm-util/ to add IPv6 support.  I am  
> currently working on modifications to system-settings/plugins/ifcfg- 
> fedora/reader.c to read in IPv6 settings.  The patch attached to this  
> message defines NMSettingIP6Config and the backend support functions  
> to work with it.  The big differences from the IP4 type are:
> 
> 1) Storing addresses at runtime as struct in6_addr, but converting  
> them to GByteArray so we can put it in a GValue for storage.
> 
> 2) More flags have been added, notably disable_ra to disable router  
> advertisement autoconfiguration.
> 
> 3) A dhcpv6_mode value is present to indicate how we should run the  
> dhcpv6 client should the user enable it.
> 
> More debugging to come, consider this a first go at this patch.  Some  
> things I am unsure of:
> 
> - When adding a GByteArray to a GArray, do you free the byte array you  
> just created?  Looking at other examples in the code, it appears that  
> GArray just holds a reference to the byte array so you don't want to  
> free it once you add it, so I didn't.  If this is incorrect, please  
> let me know and feel free to explain how GArrays work because the  
> documentation isn't spectacular.
> 
> - Since the _from_gvalue() and _to_gvalue() functions create GArrays  
> of the address structure members, the GArray element size has to be  
> consistent.  This isn't a problem for IPv4 because the address  
> structure members are all guint32 types.  For IPv6, the address and  
> gateway members are struct in6_addr and the prefix is guint32.  So  
> that's two 16-byte members and one 4-byte member.  For the GArray  
> conversion, I create a GArray large enough to hold 16-byte GByteArrays  
> and add those.  So the prefix, while unnecessary, is placed in a  
> GByteArray, but only the first 4 bytes are used.  I don't really see  
> this as a problem since it's a backend conversion that happens, but if  
> anyone sees _total failure_ written across this, let me know.

One thing that needs to be changed is the types of the properties for
DNS servers and the addresses.  They are currently still for IPv4 (uint
arrays).  Need to figure out what to use, it should be some sort of
struct actually.  That might make parsing the value in get/set property
easier.

dan

> After this patch, I have:
> * A patch for reader.c to read Fedora ifcfg files.
> * A patch to create the NMIP6Config struct in src/
> 
> Comments welcome.
> _______________________________________________ NetworkManager-list mailing list NetworkManager-list gnome org http://mail.gnome.org/mailman/listinfo/networkmanager-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]