Commit d79676fb authored by Michael Tuexen's avatar Michael Tuexen
Browse files

sctp: inherit IP level socket options from listening socket

Ensure that TTL and TOS values set on a listener get inheritet
to the accepted sockets.

PR:		260119
MFC after:	1 week
parent 36f42c5e
......@@ -2622,6 +2622,15 @@ sctp_move_pcb_and_assoc(struct sctp_inpcb *old_inp, struct sctp_inpcb *new_inp,
atomic_subtract_int(&stcb->asoc.refcnt, 1);
if (old_inp->sctp_flags & SCTP_PCB_FLAGS_BOUND_V6) {
new_inp->ip_inp.inp.inp_flags |= old_inp->ip_inp.inp.inp_flags & INP_CONTROLOPTS;
if (old_inp->ip_inp.inp.in6p_outputopts) {
new_inp->ip_inp.inp.in6p_outputopts = ip6_copypktopts(old_inp->ip_inp.inp.in6p_outputopts, M_NOWAIT);
} else {
new_inp->ip_inp.inp.inp_ip_tos = old_inp->ip_inp.inp.inp_ip_tos;
new_inp->ip_inp.inp.inp_ip_ttl = old_inp->ip_inp.inp.inp_ip_ttl;
new_inp->sctp_ep.time_of_secret_change =
memcpy(new_inp->sctp_ep.secret_key, old_inp->sctp_ep.secret_key,
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment