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)
Sat, Oct 5, 10:44 AM
Unknown Object (File)
Thu, Oct 3, 5:37 AM
Unknown Object (File)
Wed, Oct 2, 6:59 AM
Unknown Object (File)
Tue, Oct 1, 1:14 PM
Unknown Object (File)
Mon, Sep 30, 10:20 PM
Unknown Object (File)
Mon, Sep 30, 4:20 PM
Unknown Object (File)
Mon, Sep 30, 9:13 AM
Unknown Object (File)
Sat, Sep 28, 10:28 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 15432
Build 15481: 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.