diff options
author | tuexen <tuexen@FreeBSD.org> | 2018-04-07 20:37:44 +0000 |
---|---|---|
committer | tuexen <tuexen@FreeBSD.org> | 2018-04-07 20:37:44 +0000 |
commit | 35d2abea68f0f80f94ae5ea5db5de75d16bdbe99 (patch) | |
tree | 6da9d2502435fa545ea82072e6129091a60896ed /sys/netinet | |
parent | 9a9c69468a3b69096d5d1537cd02cc8c7fcb5069 (diff) | |
download | FreeBSD-src-35d2abea68f0f80f94ae5ea5db5de75d16bdbe99.zip FreeBSD-src-35d2abea68f0f80f94ae5ea5db5de75d16bdbe99.tar.gz |
MFC r328028:
Don't provide a (meaningless) cmsg when proving a notification
in a recvmsg() call.
Diffstat (limited to 'sys/netinet')
-rw-r--r-- | sys/netinet/sctputil.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/netinet/sctputil.c b/sys/netinet/sctputil.c index 8950ba4..67f2501 100644 --- a/sys/netinet/sctputil.c +++ b/sys/netinet/sctputil.c @@ -45,7 +45,7 @@ __FBSDID("$FreeBSD$"); #include <netinet/sctp_output.h> #include <netinet/sctp_uio.h> #include <netinet/sctp_timer.h> -#include <netinet/sctp_indata.h>/* for sctp_deliver_data() */ +#include <netinet/sctp_indata.h> #include <netinet/sctp_auth.h> #include <netinet/sctp_asconf.h> #include <netinet/sctp_bsd_addr.h> @@ -6091,7 +6091,7 @@ sctp_m_free(struct mbuf *m) return (m_free(m)); } -void +void sctp_m_freem(struct mbuf *mb) { while (mb != NULL) @@ -6161,6 +6161,7 @@ sctp_soreceive(struct socket *so, struct sockaddr *from; struct sctp_extrcvinfo sinfo; int filling_sinfo = 1; + int flags; struct sctp_inpcb *inp; inp = (struct sctp_inpcb *)so->so_pcb; @@ -6188,15 +6189,24 @@ sctp_soreceive(struct socket *so, if (filling_sinfo) { memset(&sinfo, 0, sizeof(struct sctp_extrcvinfo)); } - error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, flagsp, + if (flagsp != NULL) { + flags = *flagsp; + } else { + flags = 0; + } + error = sctp_sorecvmsg(so, uio, mp0, from, fromlen, &flags, (struct sctp_sndrcvinfo *)&sinfo, filling_sinfo); + if (flagsp != NULL) { + *flagsp = flags; + } if (controlp != NULL) { /* copy back the sinfo in a CMSG format */ - if (filling_sinfo) + if (filling_sinfo && ((flags & MSG_NOTIFICATION) == 0)) { *controlp = sctp_build_ctl_nchunk(inp, (struct sctp_sndrcvinfo *)&sinfo); - else + } else { *controlp = NULL; + } } if (psa) { /* copy back the address info */ |