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

Reply via email to