Comments (8)
what type of socket are you using?
one-to-one or one-to-many?
For the one-to-one the asoc-id has no meaning.. only the one-to-many I think..
R
On Jan 21, 2016, at 5:47 AM, Timo Schwarz [email protected] wrote:
Using one-to-many style sockets I want to establish a completely new association to my server by sending the first data packets using usrsctp_sendv()
As I will need the association ID of the newly established association in the future, I set infotype to SCTP_SENDV_SNDINFO and supply an all-NULL struct sctp_sndinfo
According to the RFC, when usrsctp_sendv() returns, the snd_assoc_id field should contain the association ID:
RFC6458, Page 100"For a one-to-many style socket, if the struct sctp_sndinfo attribute
is provided, the snd_assoc_id field must be 0 When this function
returns, the snd_assoc_id field will contain the association
identifier of the newly established association"Unfortunately it doesn't, snd_assoc_id will still be 0
—
Reply to this email directly or view it on GitHub.
Randall Stewart
[email protected]
803-317-4952
from usrsctp.
One-to-many, as I stated above.
from usrsctp.
Oh sorry I missed that.. this must be a bug then in the user implementation since
I know the kernel code always gives a asoc-id… I have not ever used the user
space stack (heck I hardly have time to poke at the kernel version right now).. but
I know the kernel world always gives an asoc-id.. this definitely is a bug then :-o
R
On Jan 21, 2016, at 7:04 AM, Timo Schwarz [email protected] wrote:
One-to-many, as I stated above.
—
Reply to this email directly or view it on GitHub.
Randall Stewart
[email protected]
803-317-4952
from usrsctp.
This is a bug, even in the kernel implementation, since you don't get the assoc-id via the cmsg back.
This feature is required for sctp_sendx() and sctp_sendv(). Will fix it for the userland and kernel stack...
from usrsctp.
That's great, thank you!
from usrsctp.
Let me know if it also fixed for you.
Best regards
Michael
from usrsctp.
Just for documentation. This is the program I used for testing on Mac OS X:
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <usrsctp.h>
#define ADDR "127.0.0.1"
#define PORT 9
int
main(void)
{
struct socket *sock;
struct sockaddr_in addr;
ssize_t n;
char *buffer = "This is a test message";
struct sctp_sndinfo sndinfo;
usrsctp_init(0, NULL, NULL);
usrsctp_sysctl_set_sctp_blackhole(2);
if ((sock = usrsctp_socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP, NULL, NULL, 0, NULL)) == NULL) {
perror("usrsctp_socket");
}
memset((void *)&addr, 0, sizeof(struct sockaddr_in));
addr.sin_len = sizeof(struct sockaddr_in);
addr.sin_family = AF_INET;
addr.sin_port = htons(PORT);
addr.sin_addr.s_addr = inet_addr(ADDR);
memset(&sndinfo, 0, sizeof(struct sctp_sndinfo));
sndinfo.snd_sid = 1;
sndinfo.snd_flags = SCTP_UNORDERED;
sndinfo.snd_ppid = htonl(1234);
sndinfo.snd_context = 2048;
sndinfo.snd_assoc_id = 0;
n = usrsctp_sendv(sock, buffer, strlen(buffer), (struct sockaddr *)&addr, 1, &sndinfo, (socklen_t)sizeof(struct sctp_sndinfo), SCTP_SENDV_SNDINFO, 0);
printf("usrsctp_sendv() returned %zd, snd_assoc_id = %u\n", n, sndinfo.snd_assoc_id);
sndinfo.snd_sid = 2;
sndinfo.snd_flags = SCTP_UNORDERED;
sndinfo.snd_ppid = htonl(2048);
sndinfo.snd_context = 4096;
n= usrsctp_sendv(sock, buffer, strlen(buffer), NULL, 0, &sndinfo, (socklen_t)sizeof(struct sctp_sndinfo), SCTP_SENDV_SNDINFO, 0);
printf("usrsctp_sendv() returned %zd, snd_assoc_id = %u\n", n, sndinfo.snd_assoc_id);
usrsctp_close(sock);
while (usrsctp_finish() != 0) {
sleep(1);
}
return(0);
}
from usrsctp.
The association ID is returned correctly after sendv now, so it's also fixed for me.
Thanks again!
from usrsctp.
Related Issues (20)
- Aborted with sctp_timeout_handler: tmr->self corrupted, but tmr->self is null in the core dump HOT 6
- Aborted with sodealloc(): so_count -58769387 -- suspected use-after-free in sctp_timeout_handler HOT 2
- Broken build on macOS 13.4 (apple sillicon) HOT 1
- What does usrsctp_conninput do? HOT 1
- [question] What's the release policy? HOT 2
- -Wunused-function atomic_init
- Question about the different streams in the same association HOT 2
- New release? HOT 2
- disabling sctp chunk bundling HOT 3
- user_environment.c: extra "{" in read_random()
- Q: Support for L4S HOT 1
- if usrsctp support android
- sctp over udp encapsulation does not work under NAT network : part 2 HOT 1
- Is it possiable adding BBR Congestion Control algorithm for usrsctp? HOT 1
- Crash in sctp_common_input_processing: race between usrsctp_conninput and usrsctp_accept HOT 1
- Reproducer: soref of deleted socket
- Deadlock between usrsctp_conninput and usrsctp_close HOT 1
- Self-deadlock in usrsctp_close while recv_callback is being invoked HOT 1
- sctp_pcb_finish does not destroy sctp_it_ctl.it_mtx if __Userspace__ is true
- weird LE/BE issue with sockaddr_in/6 (BSD/MacOS) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from usrsctp.