Fix typos in field names of struct sctp_extrcvinfo.

Provide defines to allow applications to compile.
Thanks to Jens Hoelscher for making me aware of the typos.

MFC after: 1 week
This commit is contained in:
Michael Tuexen 2015-11-06 13:08:16 +00:00
parent a51f980180
commit b70b526d17
3 changed files with 33 additions and 27 deletions

View File

@ -223,7 +223,7 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)
} }
seinfo = (struct sctp_extrcvinfo *)sinfo; seinfo = (struct sctp_extrcvinfo *)sinfo;
if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO) && if (sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO) &&
(seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_AVAIL)) { (seinfo->serinfo_next_flags & SCTP_NEXT_MSG_AVAIL)) {
provide_nxt = 1; provide_nxt = 1;
len += CMSG_SPACE(sizeof(struct sctp_rcvinfo)); len += CMSG_SPACE(sizeof(struct sctp_rcvinfo));
} else { } else {
@ -276,20 +276,20 @@ sctp_build_ctl_nchunk(struct sctp_inpcb *inp, struct sctp_sndrcvinfo *sinfo)
cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_nxtinfo)); cmh->cmsg_len = CMSG_LEN(sizeof(struct sctp_nxtinfo));
cmh->cmsg_type = SCTP_NXTINFO; cmh->cmsg_type = SCTP_NXTINFO;
nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmh); nxtinfo = (struct sctp_nxtinfo *)CMSG_DATA(cmh);
nxtinfo->nxt_sid = seinfo->sreinfo_next_stream; nxtinfo->nxt_sid = seinfo->serinfo_next_stream;
nxtinfo->nxt_flags = 0; nxtinfo->nxt_flags = 0;
if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_UNORDERED) { if (seinfo->serinfo_next_flags & SCTP_NEXT_MSG_IS_UNORDERED) {
nxtinfo->nxt_flags |= SCTP_UNORDERED; nxtinfo->nxt_flags |= SCTP_UNORDERED;
} }
if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_IS_NOTIFICATION) { if (seinfo->serinfo_next_flags & SCTP_NEXT_MSG_IS_NOTIFICATION) {
nxtinfo->nxt_flags |= SCTP_NOTIFICATION; nxtinfo->nxt_flags |= SCTP_NOTIFICATION;
} }
if (seinfo->sreinfo_next_flags & SCTP_NEXT_MSG_ISCOMPLETE) { if (seinfo->serinfo_next_flags & SCTP_NEXT_MSG_ISCOMPLETE) {
nxtinfo->nxt_flags |= SCTP_COMPLETE; nxtinfo->nxt_flags |= SCTP_COMPLETE;
} }
nxtinfo->nxt_ppid = seinfo->sreinfo_next_ppid; nxtinfo->nxt_ppid = seinfo->serinfo_next_ppid;
nxtinfo->nxt_length = seinfo->sreinfo_next_length; nxtinfo->nxt_length = seinfo->serinfo_next_length;
nxtinfo->nxt_assoc_id = seinfo->sreinfo_next_aid; nxtinfo->nxt_assoc_id = seinfo->serinfo_next_aid;
cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_nxtinfo))); cmh = (struct cmsghdr *)((caddr_t)cmh + CMSG_SPACE(sizeof(struct sctp_nxtinfo)));
SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_nxtinfo)); SCTP_BUF_LEN(ret) += CMSG_SPACE(sizeof(struct sctp_nxtinfo));
} }

View File

@ -138,16 +138,22 @@ struct sctp_extrcvinfo {
uint32_t sinfo_tsn; uint32_t sinfo_tsn;
uint32_t sinfo_cumtsn; uint32_t sinfo_cumtsn;
sctp_assoc_t sinfo_assoc_id; sctp_assoc_t sinfo_assoc_id;
uint16_t sreinfo_next_flags; uint16_t serinfo_next_flags;
uint16_t sreinfo_next_stream; uint16_t serinfo_next_stream;
uint32_t sreinfo_next_aid; uint32_t serinfo_next_aid;
uint32_t sreinfo_next_length; uint32_t serinfo_next_length;
uint32_t sreinfo_next_ppid; uint32_t serinfo_next_ppid;
uint16_t sinfo_keynumber; uint16_t sinfo_keynumber;
uint16_t sinfo_keynumber_valid; uint16_t sinfo_keynumber_valid;
uint8_t __reserve_pad[SCTP_ALIGN_RESV_PAD_SHORT]; uint8_t __reserve_pad[SCTP_ALIGN_RESV_PAD_SHORT];
}; };
#define sreinfo_next_flags serinfo_next_flags
#define sreinfo_next_stream serinfo_next_stream
#define sreinfo_next_aid serinfo_next_aid
#define sreinfo_next_length serinfo_next_length
#define sreinfo_next_ppid serinfo_next_ppid
struct sctp_sndinfo { struct sctp_sndinfo {
uint16_t snd_sid; uint16_t snd_sid;
uint16_t snd_flags; uint16_t snd_flags;

View File

@ -5654,20 +5654,20 @@ sctp_sorecvmsg(struct socket *so,
s_extra = (struct sctp_extrcvinfo *)sinfo; s_extra = (struct sctp_extrcvinfo *)sinfo;
if ((nxt) && if ((nxt) &&
(nxt->length)) { (nxt->length)) {
s_extra->sreinfo_next_flags = SCTP_NEXT_MSG_AVAIL; s_extra->serinfo_next_flags = SCTP_NEXT_MSG_AVAIL;
if (nxt->sinfo_flags & SCTP_UNORDERED) { if (nxt->sinfo_flags & SCTP_UNORDERED) {
s_extra->sreinfo_next_flags |= SCTP_NEXT_MSG_IS_UNORDERED; s_extra->serinfo_next_flags |= SCTP_NEXT_MSG_IS_UNORDERED;
} }
if (nxt->spec_flags & M_NOTIFICATION) { if (nxt->spec_flags & M_NOTIFICATION) {
s_extra->sreinfo_next_flags |= SCTP_NEXT_MSG_IS_NOTIFICATION; s_extra->serinfo_next_flags |= SCTP_NEXT_MSG_IS_NOTIFICATION;
} }
s_extra->sreinfo_next_aid = nxt->sinfo_assoc_id; s_extra->serinfo_next_aid = nxt->sinfo_assoc_id;
s_extra->sreinfo_next_length = nxt->length; s_extra->serinfo_next_length = nxt->length;
s_extra->sreinfo_next_ppid = nxt->sinfo_ppid; s_extra->serinfo_next_ppid = nxt->sinfo_ppid;
s_extra->sreinfo_next_stream = nxt->sinfo_stream; s_extra->serinfo_next_stream = nxt->sinfo_stream;
if (nxt->tail_mbuf != NULL) { if (nxt->tail_mbuf != NULL) {
if (nxt->end_added) { if (nxt->end_added) {
s_extra->sreinfo_next_flags |= SCTP_NEXT_MSG_ISCOMPLETE; s_extra->serinfo_next_flags |= SCTP_NEXT_MSG_ISCOMPLETE;
} }
} }
} else { } else {
@ -5678,11 +5678,11 @@ sctp_sorecvmsg(struct socket *so,
* :-D * :-D
*/ */
nxt = NULL; nxt = NULL;
s_extra->sreinfo_next_flags = SCTP_NO_NEXT_MSG; s_extra->serinfo_next_flags = SCTP_NO_NEXT_MSG;
s_extra->sreinfo_next_aid = 0; s_extra->serinfo_next_aid = 0;
s_extra->sreinfo_next_length = 0; s_extra->serinfo_next_length = 0;
s_extra->sreinfo_next_ppid = 0; s_extra->serinfo_next_ppid = 0;
s_extra->sreinfo_next_stream = 0; s_extra->serinfo_next_stream = 0;
} }
} }
/* /*
@ -6165,7 +6165,7 @@ sctp_sorecvmsg(struct socket *so,
struct sctp_extrcvinfo *s_extra; struct sctp_extrcvinfo *s_extra;
s_extra = (struct sctp_extrcvinfo *)sinfo; s_extra = (struct sctp_extrcvinfo *)sinfo;
s_extra->sreinfo_next_flags = SCTP_NO_NEXT_MSG; s_extra->serinfo_next_flags = SCTP_NO_NEXT_MSG;
} }
if (hold_rlock == 1) { if (hold_rlock == 1) {
SCTP_INP_READ_UNLOCK(inp); SCTP_INP_READ_UNLOCK(inp);