svn commit: r336298 - head/sys/netinet
Sean Bruno
sbruno at FreeBSD.org
Sat Jul 14 23:53:52 UTC 2018
Author: sbruno
Date: Sat Jul 14 23:53:51 2018
New Revision: 336298
URL: https://svnweb.freebsd.org/changeset/base/336298
Log:
There was quite a bit of feedback on r336282 that has led to the
submitter to want to revert it.
Modified:
head/sys/netinet/ip_output.c
Modified: head/sys/netinet/ip_output.c
==============================================================================
--- head/sys/netinet/ip_output.c Sat Jul 14 21:32:32 2018 (r336297)
+++ head/sys/netinet/ip_output.c Sat Jul 14 23:53:51 2018 (r336298)
@@ -1256,18 +1256,12 @@ ip_ctloutput(struct socket *so, struct sockopt *sopt)
switch (sopt->sopt_name) {
case IP_OPTIONS:
case IP_RETOPTS:
- if (inp->inp_options) {
- unsigned long len = ulmin(inp->inp_options->m_len, sopt->sopt_valsize);
- struct mbuf *options = malloc(len, M_TEMP, M_WAITOK);
- INP_RLOCK(inp);
- bcopy(inp->inp_options, options, len);
- INP_RUNLOCK(inp);
+ if (inp->inp_options)
error = sooptcopyout(sopt,
- mtod(options,
+ mtod(inp->inp_options,
char *),
- len);
- free(options, M_TEMP);
- } else
+ inp->inp_options->m_len);
+ else
sopt->sopt_valsize = 0;
break;
More information about the svn-src-head
mailing list