Page MenuHomeFreeBSD

refactor ip6_getpcbopt() for better locking and memory management
AbandonedPublic

Authored by jason_eggnet.com on Mar 8 2018, 3:57 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 OK
Unit
No Unit Test Coverage
Build Status
Buildable 15730
Build 15751: arc lint + arc unit

Event Timeline

swills added a subscriber: swills.Mar 8 2018, 4:38 PM
sbruno accepted this revision.Mar 8 2018, 5:16 PM
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

jason_eggnet.com abandoned this revision.Mar 23 2018, 12:49 AM

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