Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send IFA_CACHEINFO when setting up addresses #315

Merged
merged 2 commits into from
Jan 17, 2018
Merged

Send IFA_CACHEINFO when setting up addresses #315

merged 2 commits into from
Jan 17, 2018

Conversation

Natolumin
Copy link
Contributor

This patch implements setting the cacheinfo attributes in addrHandle, to enable setting the valid_lft and preferred_lft values on addresses inserted. Currently, these values are ignored.

There is an interface issue because the default values for these fields in go are valid values for the netlink fields, but they are not very good default values. I have implemented what I think is a reasonable interface there, but I don't believe it is especially great. Any feedback on a better way to handle these parameters would be welcome.

This also removes the IFA_BROADCAST and IFA_LABEL fields from messages for non-ipv4 addresses, since these attributes are ignored for other kinds of addresses.

The attributes IFA_BROADCAST and IFA_LABEL are only valid for ipv4: they
are not defined for ipv6 here:
http://elixir.free-electrons.com/linux/v4.6/source/net/ipv6/addrconf.c#L4231

This ignores addr.Broadcast and addr.Label for non-ipv4 addresses.
Currently, Validity and preference information values are ignored in
addrHandle. This adds them to the netlink message when they are passed
by the caller
@aboch
Copy link
Collaborator

aboch commented Jan 17, 2018

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants