summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authortuexen <tuexen@FreeBSD.org>2016-01-24 22:08:15 +0000
committertuexen <tuexen@FreeBSD.org>2016-01-24 22:08:15 +0000
commit082dc2cf03d114a3d2908246313b1786d01fee4d (patch)
tree2a1d7c77afe1d7ff3acc03ba08fb4f07fa088210 /lib/libc
parenta883ef609223b9657371e42076fc3ee4311f49b6 (diff)
downloadFreeBSD-src-082dc2cf03d114a3d2908246313b1786d01fee4d.zip
FreeBSD-src-082dc2cf03d114a3d2908246313b1786d01fee4d.tar.gz
sctp_sendv() needs to fill in the association id on return.
MFC after: 3 days
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/net/sctp_sys_calls.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libc/net/sctp_sys_calls.c b/lib/libc/net/sctp_sys_calls.c
index f07aa43..30f7fcc 100644
--- a/lib/libc/net/sctp_sys_calls.c
+++ b/lib/libc/net/sctp_sys_calls.c
@@ -984,6 +984,7 @@ sctp_sendv(int sd,
struct sockaddr *addr;
struct sockaddr_in *addr_in;
struct sockaddr_in6 *addr_in6;
+ sctp_assoc_t *assoc_id;
if ((addrcnt < 0) ||
(iovcnt < 0) ||
@@ -1002,6 +1003,7 @@ sctp_sendv(int sd,
errno = ENOMEM;
return (-1);
}
+ assoc_id = NULL;
msg.msg_control = cmsgbuf;
msg.msg_controllen = 0;
cmsg = (struct cmsghdr *)cmsgbuf;
@@ -1025,6 +1027,7 @@ sctp_sendv(int sd,
memcpy(CMSG_DATA(cmsg), info, sizeof(struct sctp_sndinfo));
msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo));
cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo)));
+ assoc_id = &(((struct sctp_sndinfo *)info)->snd_assoc_id);
break;
case SCTP_SENDV_PRINFO:
if ((info == NULL) || (infolen < sizeof(struct sctp_prinfo))) {
@@ -1066,6 +1069,7 @@ sctp_sendv(int sd,
memcpy(CMSG_DATA(cmsg), &spa_info->sendv_sndinfo, sizeof(struct sctp_sndinfo));
msg.msg_controllen += CMSG_SPACE(sizeof(struct sctp_sndinfo));
cmsg = (struct cmsghdr *)((caddr_t)cmsg + CMSG_SPACE(sizeof(struct sctp_sndinfo)));
+ assoc_id = &(spa_info->sendv_sndinfo.snd_assoc_id);
}
if (spa_info->sendv_flags & SCTP_SEND_PRINFO_VALID) {
cmsg->cmsg_level = IPPROTO_SCTP;
@@ -1164,6 +1168,9 @@ sctp_sendv(int sd,
msg.msg_flags = 0;
ret = sendmsg(sd, &msg, flags);
free(cmsgbuf);
+ if ((ret >= 0) && (addrs != NULL) && (assoc_id != NULL)) {
+ *assoc_id = sctp_getassocid(sd, addrs);
+ }
return (ret);
}
OpenPOWER on IntegriCloud