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
F81946857: D14619.id40619.diff
Tue, Apr 23, 2:42 PM
Unknown Object (File)
Sat, Apr 20, 1:49 PM
Unknown Object (File)
Fri, Apr 19, 2:50 PM
Unknown Object (File)
Sat, Apr 13, 11:44 AM
Unknown Object (File)
Feb 2 2024, 6:08 PM
Unknown Object (File)
Jan 24 2024, 5:33 PM
Unknown Object (File)
Jan 18 2024, 11:19 PM
Unknown Object (File)
Dec 26 2023, 7:11 AM

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.