Thanks Waldo,
Please find patch attached along with new element.c source file if required.
The patch proposal is to modify:
- __connman_element_append_ipv4
- __connman_element_set_ipv4
- connman_element_get_value
to support broadcast and nameserver settings.

Regards,

Jonathan



-----Original Message-----
From: Bastian, Waldo [mailto:[email protected]] 
Sent: Wednesday, June 17, 2009 5:16 PM
To: Jonathan De Cesco
Cc: [email protected]
Subject: RE: [connman] List issue + Connman crash on
connman_device_set_carrier(device, TRUE) + connman_resolver_append problem

Hi Jonathan,

I think that the lack of support for Broadcast/Nameserver properties is a
bug, can you provide a patch to add support for these properties to
__connman_element_set_ipv4?

Cheers,
Waldo
-- 
Intel Corporation - Hillsboro, Oregon
Ultra Mobility Group - Platform Software Architecture
Tel: +1 503 264 6237 - Mobile: +1 503 703-7327

> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of Jonathan De Cesco
> Sent: Friday, June 12, 2009 3:53 AM
> To: [email protected]
> Subject: Re: [connman] List issue + Connman crash on
> connman_device_set_carrier(device, TRUE) + connman_resolver_append problem
> 
> Thanks,
> From an external connman plugin perspective, I only have access to the
> "device" structure, I cannot play with the element directly as it is
> created
> for me in the background. Is there a way to retrieve the device IPV4
> element
> once it has been created by Connman and access all its properties?
> Why are Broadcast and Nameserver properties handled differently for the
> IPV4
> element?
> 
> I tried using latest connman from git but I have some issues to make it
> load
> my plugin.
> 
> Regards,
> 
> Jonathan
> 
> 
> -----Original Message-----
> From: [email protected] [mailto:[email protected]] On
> Behalf Of Bastian, Waldo
> Sent: Thursday, June 11, 2009 6:00 PM
> To: [email protected]
> Subject: Re: [connman] List issue + Connman crash on
> connman_device_set_carrier(device, TRUE) + connman_resolver_append problem
> 
> Jonathan De Cesco wrote:
> > I am using connman 0.19-3.1 and I am doing a plugin that is setting up a
> > device with CONNMAN_DEVICE_MODE_TRANSPORT_IP mode, I give it the
> following
> > properties:
> > connman_device_set_interface(device,"an interfaceName");
> > "IPv4.Method" = "static"
> > "IPv4.Address" = "an IP address"
> > "IPv4.Netmask" = "255.255.255.0"
> > "IPv4.Gateway" = "another IP address"
> > These properties are set correctly and I can see they are applied fine
> to
> > the IPV4 element/
> >
> > However, I am not able to set the Broadcast and nameserver properties,
> is
> > there something like:
> > "IPv4.Broadcast" and "IPv4.Nameserver" properties, I tried everything
> and
> > nothing seems to work.
> 
> There are
> CONNMAN_PROPERTY_ID_IPV4_BROADCAST
> CONNMAN_PROPERTY_ID_IPV4_NAMESERVER
> 
> They are handled by connman_element_get_value() but not by
> __connman_element_set_ipv4(), not sure if that is intentional or an
> oversight.
> 
> plugins/udhcp.c sets broadcast and nameserver directly on the element as
> follows:
> 
> 139         g_free(parent->ipv4.broadcast);
> 140         parent->ipv4.broadcast = g_strdup(broadcast);
> 141
> 142         g_free(parent->ipv4.gateway);
> 143         parent->ipv4.gateway = g_strdup(gateway);
> 144
> 145         g_free(parent->ipv4.nameserver);
> 146         parent->ipv4.nameserver = g_strdup(dns);
> 147
> 148         connman_element_update(parent);
> 
> Maybe you can do the same?
> 
> > Now, when I call connman_device_set_carrier(device, TRUE) I get a
> > segmentation fault in connman. I suspect the connman IPV4 probe function
> > to
> > fail as I did not provide it any Broadcast address ? Could that be the
> > reason, is this a bug at connman level, I may not be using correctly the
> > connman APIs.
> >
> > Another issue, I tried to set the nameservers IPs using successive calls
> > to:
> > connman_resolver_append(interface_name, NULL, dns1_addr);
> > connman_resolver_append(interface_name, NULL, dns2_addr);
> >
> > However, the resulting /etc/resolv.conf contains only the last dns
> address
> > and previous dns entries are removed...
> 
> Are you using the latest connman from git?
> 
> Cheers,
> Waldo
> --
> Intel Corporation - Hillsboro, Oregon
> Ultra Mobility Group - Platform Software Architecture
> Tel: +1 503 264 6237 - Mobile: +1 503 703-7327
> _______________________________________________
> connman mailing list
> [email protected]
> http://lists.connman.net/listinfo/connman
> 
> 
> 
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature
> database 4148 (20090611) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
> 
> 
> 
> __________ Information from ESET NOD32 Antivirus, version of virus
> signature
> database 4150 (20090612) __________
> 
> The message was checked by ESET NOD32 Antivirus.
> 
> http://www.eset.com
> 
> 
> _______________________________________________
> connman mailing list
> [email protected]
> http://lists.connman.net/listinfo/connman

 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4162 (20090617) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 
 

__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4163 (20090617) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com
 

Attachment: connman.patch
Description: Binary data

Attachment: element.c
Description: Binary data

_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to