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, 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
Unknown Object (File)
Dec 9 2023, 11:29 PM
Unknown Object (File)
Dec 6 2023, 8:02 PM
Unknown Object (File)
Nov 17 2023, 8:28 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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

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

2315

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

head/sys/netinet6/ip6_output.c
2315

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.