diff options
author | Michael Tuexen <tuexen@FreeBSD.org> | 2020-10-06 10:41:04 +0000 |
---|---|---|
committer | Michael Tuexen <tuexen@FreeBSD.org> | 2020-10-06 10:41:04 +0000 |
commit | 11daa73adcd4be7ac408b759462b691cb5253930 (patch) | |
tree | b9981428d0a722f1703383fcf980431a5b6cb2e6 /sys/netinet/sctp_usrreq.c | |
parent | a113b1037fec4fd91b5c38022db30893511f7480 (diff) | |
download | src-11daa73adcd4be7ac408b759462b691cb5253930.tar.gz src-11daa73adcd4be7ac408b759462b691cb5253930.zip |
Cleanup, no functional change intended.
MFC after: 3 days
Notes
Notes:
svn path=/head/; revision=366480
Diffstat (limited to 'sys/netinet/sctp_usrreq.c')
-rw-r--r-- | sys/netinet/sctp_usrreq.c | 52 |
1 files changed, 18 insertions, 34 deletions
diff --git a/sys/netinet/sctp_usrreq.c b/sys/netinet/sctp_usrreq.c index 4e1a11527d73..685bc457d724 100644 --- a/sys/netinet/sctp_usrreq.c +++ b/sys/netinet/sctp_usrreq.c @@ -3077,43 +3077,27 @@ flags_out: break; } case SCTP_RECVRCVINFO: - { - int onoff; - - if (*optsize < sizeof(int)) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - error = EINVAL; - } else { - SCTP_INP_RLOCK(inp); - onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO); - SCTP_INP_RUNLOCK(inp); - } - if (error == 0) { - /* return the option value */ - *(int *)optval = onoff; - *optsize = sizeof(int); - } - break; + if (*optsize < sizeof(int)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } else { + SCTP_INP_RLOCK(inp); + *(int *)optval = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVRCVINFO); + SCTP_INP_RUNLOCK(inp); + *optsize = sizeof(int); } + break; case SCTP_RECVNXTINFO: - { - int onoff; - - if (*optsize < sizeof(int)) { - SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); - error = EINVAL; - } else { - SCTP_INP_RLOCK(inp); - onoff = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO); - SCTP_INP_RUNLOCK(inp); - } - if (error == 0) { - /* return the option value */ - *(int *)optval = onoff; - *optsize = sizeof(int); - } - break; + if (*optsize < sizeof(int)) { + SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL); + error = EINVAL; + } else { + SCTP_INP_RLOCK(inp); + *(int *)optval = sctp_is_feature_on(inp, SCTP_PCB_FLAGS_RECVNXTINFO); + SCTP_INP_RUNLOCK(inp); + *optsize = sizeof(int); } + break; case SCTP_DEFAULT_SNDINFO: { struct sctp_sndinfo *info; |