aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/socket.c
diff options
context:
space:
mode:
authorIvan Skytte Jorgensen <isj-sctp@i1.dk>2005-10-28 18:10:00 -0400
committerSridhar Samudrala <sri@us.ibm.com>2005-10-28 18:10:00 -0400
commiteaa5c54dbec70e2a93d6ed412bb589bbf9c90a17 (patch)
tree4047a75f7f74d978bad9c4862afbd47c8cda595a /net/sctp/socket.c
parent741b2252a5e14d6c60a913c77a6099abe73a854a (diff)
[SCTP] Rename SCTP specific control message flags.
Rename SCTP specific control message flags to use SCTP_ prefix rather than MSG_ prefix as per the latest sctp sockets API draft. Signed-off-by: Ivan Skytte Jorgensen <isj-sctp@i1.dk> Signed-off-by: Sridhar Samudrala <sri@us.ibm.com>
Diffstat (limited to 'net/sctp/socket.c')
-rw-r--r--net/sctp/socket.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/net/sctp/socket.c b/net/sctp/socket.c
index 02e068d3450d..170045b6ee98 100644
--- a/net/sctp/socket.c
+++ b/net/sctp/socket.c
@@ -1389,27 +1389,27 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1389 SCTP_DEBUG_PRINTK("msg_len: %zu, sinfo_flags: 0x%x\n", 1389 SCTP_DEBUG_PRINTK("msg_len: %zu, sinfo_flags: 0x%x\n",
1390 msg_len, sinfo_flags); 1390 msg_len, sinfo_flags);
1391 1391
1392 /* MSG_EOF or MSG_ABORT cannot be set on a TCP-style socket. */ 1392 /* SCTP_EOF or SCTP_ABORT cannot be set on a TCP-style socket. */
1393 if (sctp_style(sk, TCP) && (sinfo_flags & (MSG_EOF | MSG_ABORT))) { 1393 if (sctp_style(sk, TCP) && (sinfo_flags & (SCTP_EOF | SCTP_ABORT))) {
1394 err = -EINVAL; 1394 err = -EINVAL;
1395 goto out_nounlock; 1395 goto out_nounlock;
1396 } 1396 }
1397 1397
1398 /* If MSG_EOF is set, no data can be sent. Disallow sending zero 1398 /* If SCTP_EOF is set, no data can be sent. Disallow sending zero
1399 * length messages when MSG_EOF|MSG_ABORT is not set. 1399 * length messages when SCTP_EOF|SCTP_ABORT is not set.
1400 * If MSG_ABORT is set, the message length could be non zero with 1400 * If SCTP_ABORT is set, the message length could be non zero with
1401 * the msg_iov set to the user abort reason. 1401 * the msg_iov set to the user abort reason.
1402 */ 1402 */
1403 if (((sinfo_flags & MSG_EOF) && (msg_len > 0)) || 1403 if (((sinfo_flags & SCTP_EOF) && (msg_len > 0)) ||
1404 (!(sinfo_flags & (MSG_EOF|MSG_ABORT)) && (msg_len == 0))) { 1404 (!(sinfo_flags & (SCTP_EOF|SCTP_ABORT)) && (msg_len == 0))) {
1405 err = -EINVAL; 1405 err = -EINVAL;
1406 goto out_nounlock; 1406 goto out_nounlock;
1407 } 1407 }
1408 1408
1409 /* If MSG_ADDR_OVER is set, there must be an address 1409 /* If SCTP_ADDR_OVER is set, there must be an address
1410 * specified in msg_name. 1410 * specified in msg_name.
1411 */ 1411 */
1412 if ((sinfo_flags & MSG_ADDR_OVER) && (!msg->msg_name)) { 1412 if ((sinfo_flags & SCTP_ADDR_OVER) && (!msg->msg_name)) {
1413 err = -EINVAL; 1413 err = -EINVAL;
1414 goto out_nounlock; 1414 goto out_nounlock;
1415 } 1415 }
@@ -1458,14 +1458,14 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1458 goto out_unlock; 1458 goto out_unlock;
1459 } 1459 }
1460 1460
1461 if (sinfo_flags & MSG_EOF) { 1461 if (sinfo_flags & SCTP_EOF) {
1462 SCTP_DEBUG_PRINTK("Shutting down association: %p\n", 1462 SCTP_DEBUG_PRINTK("Shutting down association: %p\n",
1463 asoc); 1463 asoc);
1464 sctp_primitive_SHUTDOWN(asoc, NULL); 1464 sctp_primitive_SHUTDOWN(asoc, NULL);
1465 err = 0; 1465 err = 0;
1466 goto out_unlock; 1466 goto out_unlock;
1467 } 1467 }
1468 if (sinfo_flags & MSG_ABORT) { 1468 if (sinfo_flags & SCTP_ABORT) {
1469 SCTP_DEBUG_PRINTK("Aborting association: %p\n", asoc); 1469 SCTP_DEBUG_PRINTK("Aborting association: %p\n", asoc);
1470 sctp_primitive_ABORT(asoc, msg); 1470 sctp_primitive_ABORT(asoc, msg);
1471 err = 0; 1471 err = 0;
@@ -1477,7 +1477,7 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1477 if (!asoc) { 1477 if (!asoc) {
1478 SCTP_DEBUG_PRINTK("There is no association yet.\n"); 1478 SCTP_DEBUG_PRINTK("There is no association yet.\n");
1479 1479
1480 if (sinfo_flags & (MSG_EOF | MSG_ABORT)) { 1480 if (sinfo_flags & (SCTP_EOF | SCTP_ABORT)) {
1481 err = -EINVAL; 1481 err = -EINVAL;
1482 goto out_unlock; 1482 goto out_unlock;
1483 } 1483 }
@@ -1611,10 +1611,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
1611 1611
1612 /* If an address is passed with the sendto/sendmsg call, it is used 1612 /* If an address is passed with the sendto/sendmsg call, it is used
1613 * to override the primary destination address in the TCP model, or 1613 * to override the primary destination address in the TCP model, or
1614 * when MSG_ADDR_OVER flag is set in the UDP model. 1614 * when SCTP_ADDR_OVER flag is set in the UDP model.
1615 */ 1615 */
1616 if ((sctp_style(sk, TCP) && msg_name) || 1616 if ((sctp_style(sk, TCP) && msg_name) ||
1617 (sinfo_flags & MSG_ADDR_OVER)) { 1617 (sinfo_flags & SCTP_ADDR_OVER)) {
1618 chunk_tp = sctp_assoc_lookup_paddr(asoc, &to); 1618 chunk_tp = sctp_assoc_lookup_paddr(asoc, &to);
1619 if (!chunk_tp) { 1619 if (!chunk_tp) {
1620 err = -EINVAL; 1620 err = -EINVAL;
@@ -4640,8 +4640,8 @@ SCTP_STATIC int sctp_msghdr_parse(const struct msghdr *msg,
4640 4640
4641 /* Minimally, validate the sinfo_flags. */ 4641 /* Minimally, validate the sinfo_flags. */
4642 if (cmsgs->info->sinfo_flags & 4642 if (cmsgs->info->sinfo_flags &
4643 ~(MSG_UNORDERED | MSG_ADDR_OVER | 4643 ~(SCTP_UNORDERED | SCTP_ADDR_OVER |
4644 MSG_ABORT | MSG_EOF)) 4644 SCTP_ABORT | SCTP_EOF))
4645 return -EINVAL; 4645 return -EINVAL;
4646 break; 4646 break;
4647 4647