Page MenuHomeFreeBSD

netinet6: store ND context directly in struct in6_ifextra
AcceptedPublic

Authored by glebius on Thu, Jan 15, 3:25 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jan 22, 4:04 AM
Unknown Object (File)
Thu, Jan 22, 3:06 AM
Unknown Object (File)
Wed, Jan 21, 7:10 AM
Unknown Object (File)
Thu, Jan 15, 5:18 PM
Unknown Object (File)
Thu, Jan 15, 12:50 PM
Unknown Object (File)
Thu, Jan 15, 11:14 AM
Unknown Object (File)
Thu, Jan 15, 8:47 AM
Unknown Object (File)
Thu, Jan 15, 7:03 AM

Details

Reviewers
jhibbits
madpilot
tuexen
Group Reviewers
network
transport
Summary

Stop using struct nd_ifinfo for that, because it is an API struct for
SIOCGIFINFO_IN6. The functional changes are isolated to the protocol
attach and detach: in6_ifarrival(), nd6_ifattach(), in6_ifdeparture(),
nd6_ifdetach(), as well as to the nd6_ioctl(), nd6_ra_input(),
nd6_slowtimo() and in6_ifmtu().

The dad_failures member was just renamed to match the rest. The M_IP6NDP
malloc(9) type declaration moved to files that actually use it.

The rest of the changes are mechanical substitution of double pointer
dereference via ND_IFINFO() to a single pointer dereference. This was
achieved with a sed(1) script:

s/ND_IFINFO\(([a-z0-9>_.-]+)\)->(flags|linkmtu|basereachable|reachable|retrans|chlim)/\1->if_inet6->nd_\2/g
s/nd_chlim/nd_curhoplimit/g

Diff Detail

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

Event Timeline

tuexen added a subscriber: tuexen.
tuexen added inline comments.
sys/netinet6/in6.c
2632

Maybe use something like:

	const uint32_t linkmtu = ifp->if_inet6->nd_linkmtu;
	const uint32_t maxmtu = ifp->if_inet6->nd_maxmtu;
	const uint32_t if_mtu = ifp->if_inet6->if_mtu;

For me that is more readable and possibly more inline with style.9. But I leave that up to you.

2634

Maybe:

if (linkmtu > 0 && linkmtu < ifmtu)
	return (linkmtu);
if (maxmtu > 0 && maxmtu < ifmtu)
	return (maxmtu);
return (ifmtu);

is more easier to read. But I leave that also up to you.

This revision is now accepted and ready to land.Fri, Jan 23, 9:01 PM

In in6_ifmtu() unroll the two level ternary operator into a more readable form.

This revision now requires review to proceed.Fri, Jan 23, 9:22 PM
This revision is now accepted and ready to land.Fri, Jan 23, 10:32 PM