Page MenuHomeFreeBSD

in6: Add a helper function to compute expiry times
AcceptedPublic

Authored by markj on Tue, Jan 6, 4:03 PM.
Tags
None
Referenced Files
F141915263: D54561.diff
Mon, Jan 12, 11:25 AM
F141879347: D54561.diff
Sun, Jan 11, 9:59 PM
Unknown Object (File)
Sat, Jan 10, 3:13 PM
Unknown Object (File)
Sat, Jan 10, 4:49 AM
Unknown Object (File)
Fri, Jan 9, 10:29 AM
Unknown Object (File)
Fri, Jan 9, 12:05 AM
Unknown Object (File)
Thu, Jan 8, 11:50 AM
Unknown Object (File)
Thu, Jan 8, 5:35 AM

Details

Reviewers
glebius
pouria
zlei
tuexen
Group Reviewers
network
Summary

Tidy up a bunch of places that have the same duplicated logic. Simplify
callers of in6_init_prefix_ltimes(). No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 69664
Build 66547: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Tue, Jan 6, 4:28 PM
pouria added a subscriber: pouria.

LGTM. Why don't you inline it? I know that the compiler will do ultimately what it wants. but at least we can suggest the right thing to it.

In D54561#1246639, @p.mousavizadeh_protonmail.com wrote:

LGTM. Why don't you inline it? I know that the compiler will do ultimately what it wants. but at least we can suggest the right thing to it.

The function is used in multiple compilation units, so to make it inline the definition would have to be in a header, probably nd6.h since that's where ND6_INFINITE_LIFETIME is defined.

We could put it there, but I don't see much of a reason: this code is only used in control paths and is definitely not performance-sensitive. And since the helper references the global time_uptime, we'd have to pull in time.h, which feels like overkill to me.

So I did the simpler thing and just defined it in in6.c.

The function is used in multiple compilation units, so to make it inline the definition would have to be in a header, probably nd6.h since that's where ND6_INFINITE_LIFETIME is defined.

You're right! it's definitely overkill. Thank you!

zlei added a subscriber: zlei.

Looks good to me.