- Subject: [PATCH] sctp_test: don't specifc the destination address when sendint data for multi-home mode
- From: Shan Wei <shanwei@xxxxxxxxxxxxxx>
- Date: Fri, 03 Sep 2010 14:52:31 +0800
- Cc: linux-sctp@xxxxxxxxxxxxxxx
- User-agent: Thunderbird 2.0.0.23 (X11/20090817)
For multi-home mode, don't need to specific msg_name.
If msg_name is set, this will force sctp send data to the destination address
to which msg_name is pointed.
So, this patch will cause sctp to choose primary path to send data.
Signed-off-by: Shan Wei <shanwei@xxxxxxxxxxxxxx>
---
src/apps/sctp_test.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/src/apps/sctp_test.c b/src/apps/sctp_test.c
index 7287d05..7922686 100644
--- a/src/apps/sctp_test.c
+++ b/src/apps/sctp_test.c
@@ -1005,8 +1005,14 @@ int send_r(int sk, int stream, int order, int send_size, int assoc_i)
}
}
- outmsg.msg_name = &s_rem;
- outmsg.msg_namelen = sizeof(struct sockaddr_storage);
+ if (connectx_count != 0) {
+ outmsg.msg_name = NULL;
+ outmsg.msg_namelen = 0;
+ }
+ else {
+ outmsg.msg_name = &s_rem;
+ outmsg.msg_namelen = sizeof(struct sockaddr_storage);
+ }
outmsg.msg_iov = &iov;
outmsg.msg_iovlen = 1;
outmsg.msg_control = outcmsg;
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Linux OMAP]
[Linux USB Devel]
[Video for Linux]
[Linux Audio Users]
[Photo]
[Yosemite News]
[Yosemite Photos]
[Free Online Dating]
[Linux Kernel]
[Linux SCSI]
[XFree86]