I am in the process of implementing a new protocol package and the protocol is configured via an interface stanza in /etc/config/network. This interface stanza has a dependency on IP information from an underlying interface also defined in /etc/config/network. The underlying interface may be either static or DHCP. Currently, everything works well if the underlying interface is static, since the IP information is immediately available. But in the case of the DHCP interface, my interface stanza is being triggered prior to the successful DHCP negotiation of the underlying interface and is failing since no IP information is available yet. I was trying to use proto_add_host_dependency to resolve this issue, but this doesn't seem to do what I require. Can someone point me to an example of something similar to what is needed for my interface stanza?
option ifname @other_iface where
other_iface corresponds to the name of the
config interface section of the underlying interface.
Does this only work with "option ifname"? Technically, my interface has a dependency on two different underlying interfaces that can both be either DHCP or static, so it has to potentially wait for both to successfully negotiate DHCP. My interface stanza uses custom defined options for each of these underlying interfaces. I attempted to use the @ifname syntax within these custom options, but it does not appear to work. I assumed it would since I have seen a similar convention used with the "option tunlink" for GRE interface stanza.
Yes it only works with option ifname. There is no way to express dependencies on multiple underlying interfaces as far as I know.
Are you certain this only works for "option ifname"? Because I know the same convention is used for "option tunlink" with GRE tunnel interfaces... it would not be possible to configure the GRE tunnel without being able to retrieve the IP information from its underlying interface for the local address of the tunnel.
As an alternative, if I additionally add the "option ifname" to my interface stanza and do something like:
option ifname "@ifname1 @ifname2"? And have it wait for both to complete DHCP negotiation? I have seen this list syntax used somewhere.
Do you happen to know where the code is that parses the @ifname in /etc/config/network and creates a dependency?