On Mon 12.02.18 10:58, Daniel Wagner wrote:
Good Morning Christian,
> So, here more concrete questions:
> - We could use the utility functions in gdhcp/ipv4ll.c for sending arp packets.
> The functions ipv4ll_send_arp_packet and ipv4ll_arp_socket are not specific to
> dhcp. Should I move them to another folder (src, or new arp) and rename them?
Indeed the ipv4ll_ are not specific to dhcp but currently we just have
one user. If you need it in src, then yes please move it there.
Ok. Then I will move it to src.
> - As you stated, very useful is also gdhcp/client.c. The
> send_probe_packet, send_announce_packet, and so on do exactly what we need for
> ACD. But they are all related to dhcp because they use the structure GDHCPClient.
> ACD should work for dhcp and static ipv4 configurations.
> Do you want some refactoring? Clearly, the simplest way is to copy and rewrite
> these functions and don't touch client.c. What do you think?
Please don't do code duplication because it is a maintenance nightmare
in the long run.
Ok, then refactoring. Good choice!
> - Last question is where to trigger the ACD. I made a call-graph
> which functions lead to inet.c function
> where the ip address is assigned to the interface. (Dot code below!) Maybe ACD
> should be triggered in inet.c function
> connman_inet_set_address ?
> This also influences vpn-ipconfig.c and vpn-provider.c where
> connman_inet_set_address is called. Or should I place it one step upward in
> ipconfig.c function
> __connman_ipconfig_address_add ?
I didn't look into ACD yet. So my comments might not make sense. So far
the assumption was, whenever ConnMan is not setting a static address it
will ask the dhcp subsystem (unless IPv6 autoconfig) to fetch the
configuration. That's also why ipv4ll lives in this directory. Are you
sure you need to have ACD separated from the current gdhcp code? The RFC
even speaks from a strong relationship to ipv4ll.
Maybe you can start with the current structure and see if it fits or
not. Don't hesitate to post early draft versions of the code if you need
feedback. It is always a bit difficult to give good advice without
looking at real code.
Ok, I will try to make a proposition. But it has to be more general than only
for dhcp. Also for static ipv4.