Page MenuHomeFreeBSD

refactor ip6_getpcbopt() for better locking and memory management
AbandonedPublic

Authored by jason_eggnet.com on Mar 8 2018, 3:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 24, 7:58 PM
Unknown Object (File)
Fri, Nov 22, 6:38 AM
Unknown Object (File)
Wed, Nov 20, 1:52 PM
Unknown Object (File)
Tue, Nov 5, 9:12 AM
Unknown Object (File)
Oct 17 2024, 5:34 PM
Unknown Object (File)
Oct 16 2024, 11:25 PM
Unknown Object (File)
Oct 16 2024, 5:54 AM
Unknown Object (File)
Oct 15 2024, 12:38 PM

Details

Summary

Created GET_PKTOPT_EXT_HDR() and GET_PKTOPT_SOCKADDR() macros to
handle safely fetching options from in6p_outputopts, including
properly dealing with in6p locking and preparing memory for
sooptcopyout().

Changed the function signature of ip6_getpcbopt() to allow the
function to acquire and release locks on in6p as needed.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 15730
Build 15751: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Mar 8 2018, 5:16 PM
This revision was automatically updated to reflect the committed changes.
melifaro added inline comments.
head/sys/netinet6/ip6_output.c
2312 ↗(On Diff #40619)

Why don't we declare this as function? It will be much easier to maintain.

2315 ↗(On Diff #40619)

optdatalen = min(lenexpr, sopt->sopt_valsize) ? :-)

head/sys/netinet6/ip6_output.c
2315 ↗(On Diff #40619)

yeah :)

fix malloc length in ip6_output.c:GET_PKTOPT_VAR

I will start a new review to address feedback from @melifaro, this one is broken.