Skip to content

Commit 6437409

Browse files
committed
Removed accept() from the SOCK_SEQPACKET flow, as per the man-page sctp(7)
1 parent 0fccc85 commit 6437409

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/listendemo.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,11 +131,13 @@ int main (int argc, char *argv []) {
131131
argv [0], strerror (errno));
132132
exit (1);
133133
}
134-
sox = accept (sox, NULL, 0);
135-
if (sox == -1) {
136-
fprintf (stderr, "%s: Failed to accept connection from socket: %s\n",
137-
argv [0], strerror (errno));
138-
exit (1);
134+
if (cnxtp == SOCK_STREAM) {
135+
sox = accept (sox, NULL, 0);
136+
if (sox == -1) {
137+
fprintf (stderr, "%s: Failed to accept connection from socket: %s\n",
138+
argv [0], strerror (errno));
139+
exit (1);
140+
}
139141
}
140142
}
141143

0 commit comments

Comments
 (0)