toggle quoted messageShow quoted text
You are now looking the subsys/net/lib/config/init.c which is only used
when the device starts. There is no ADD handler for manual addition of
IPv4 address because the manual address is added automatically by that
I created a new version of PR#9370 which is now a bit more simpler and
easier to understand. Please review and comment there if you have
On Mon, 2019-04-15 at 19:25 +0000, Prabhu Vinod, Karthik wrote:
Just a follow-up question:
So I was going through the code, I realized the
NET_EVENT_IPV4_ADDR_ADD event only works when the setup uses DHCP.
Looks it won't work if the IP address is statically allocated. Is my
As a work around for this: In case of static allocation can I do
1.) Reassign the same static ip-address to the interface using
net_if_ipv4_addr_add like net_if_ipv4_addr_add(iface, &addr,
a.) net_if_ipv4_addr_add returns NULL if the ip address cannot
be added if the network is not ready or some other error:
b.) net_if_ipv4_addr_add returns a pointer to the
network_interface if the ip address could be successfully added.
3.) That generates the event.
Does it make sense?
Karthik Prabhu Vinod
Help save the planet by choosing not to use single use plastics. Pick
paper, bamboo or metal cutlery and carry your own bag to the grocery
store. Every little thing you do makes an impact.
On 4/10/19, 9:56 AM, "email@example.com on behalf of
Prabhu Vinod, Karthik" <firstname.lastname@example.org on behalf of
Sounds good. Thank you so much Jukka. I think I will end up using
NET_EVENT_IPV4_ADDR_ADD event for now. Any expected ETA for the patch
you mentioned? ...Approximately !
Karthik Prabhu Vinod
Help save the planet by choosing not to use single use plastics.
Pick paper, bamboo or metal cutlery and carry your own bag to the
grocery store. Every little thing you do makes an impact.
On 4/10/19, 1:35 AM, "email@example.com on behalf of
Jukka Rissanen" <firstname.lastname@example.org on behalf of
For IPv4 monitoring NET_EVENT_IPV4_ADDR_ADD is best option
For IPv6 the NET_EVENT_IPV6_DAD_SUCCEED and/or
NET_EVENT_IPV6_ROUTER_ADD should be used instead.
These events are not optimal and some more work is needed in
to make this more generic. So something like this draft
On Tue, 2019-04-09 at 22:13 +0000, Prabhu Vinod, Karthik
> I wanted to know if there are network events which I can
> to know when the network init is complete. If there is one,
I want to
> wait and use the callback to notify my app that then It can
> socket_connection. Because a socket connection on a non-
> is blocking call.
> I looked through include/net/net_event.h and found that
> NET_EVENT_IPV4_ADDR_ADD which comes closest to our use case
> assigning IPv4 address to an network interface should be
> to perform in a network_boot sequence. Is there something
else that I
> could do?
> Many Regards,
> Karthik Prabhu Vinod
> Help save the planet by choosing not to use single use
> paper, bamboo or metal cutlery and carry your own bag to
> store. Every little thing you do makes an impact.