[systemd-devel] Persistent address on "Lost carrier"
Amish
anon.amish at gmail.com
Sat Jun 17 05:27:36 UTC 2017
On Friday 16 June 2017 01:06 PM, Lennart Poettering wrote:
> On Thu, 15.06.17 18:22, Amish (anon.amish at gmail.com) wrote:
>
>>> Hmm, that wasn't the actual question though, was it? The point was just
>>> to make networkd ignore carrier status (i.e. often there's no need to
>>> remove addresses just because the interface is down for a moment), not
>>> to stop managing halfway.
> Adding an option "IgnoreCarrier=" or so would be OK I figure. Best way
> to get it implemented is submitting a PR for it ;-)
>
Ok I am completely new to systemd.
So looking at the code and trying to figure out the flow.
I believe I have to add IgnoreCarrier option in link-config.[ch] file.
Function that handles "Lost/Gain Carrier" is in networkd-link.c
There are two struct here: one is "link_config" and other is "Link"
link-config is what will store boolean ignore_carrier. (or any
configuration value)
Link is what stores actual link data. (carrier status)
I am kind of stuck at one place. Searched a lot - but could not figure out.
I could not find anyway to find underlying "link_config" associated with
"Link".
For example:
Inside networkd-link.c how do I check this:
if (Link->link_config->ignore_carrier) {
// do nothing
}
else {
// continue existing code
}
Please also have a look at whatever I have done so far, here:
https://github.com/amishxda/systemd/commits/master
Thanks
Amish.
PS: Dont know if this list is right place to ask such questions.
But since its "-devel" mailing list I am posting here.
More information about the systemd-devel
mailing list