[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.1.10.0805181244480.15590@fbirervta.pbzchgretzou.qr>
Date: Sun, 18 May 2008 12:58:55 +0200 (CEST)
From: Jan Engelhardt <jengelh@...ozas.de>
To: netdev@...r.kernel.org
Subject: IPV6_V6ONLY ignored for SCTP
Hi,
with the following short C program, I get "Address already in use"
(when binding 'b'), but only when using IPPROTO_SCTP. When I use
IPPROTO_TCP for 'a' and 'b', everything is fine. Seems like SCTP
is ignoring the V6ONLY flag.
Running kernel is 2.6.25.3 on i686. Any other info needed?
Thanks,
Jan
--<<---
#include <arpa/inet.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <stdio.h>
#define p(x) if ((x) < 0) perror("urgh")
int main(void)
{
int a, b, y = 1;
p(a = socket(PF_INET, SOCK_STREAM, IPPROTO_SCTP));
p(b = socket(PF_INET6, SOCK_STREAM, IPPROTO_SCTP));
p(setsockopt(b, IPPROTO_IPV6, IPV6_V6ONLY, &y, sizeof(y)));
p(bind(a, (const void *)&(struct sockaddr_in){.sin_family = PF_INET,
.sin_port = htons(3333)}, sizeof(struct sockaddr_in)));
p(listen(a, SOMAXCONN));
p(bind(b, (const void *)&(struct sockaddr_in6){.sin6_family = PF_INET6,
.sin6_port = htons(3333)}, sizeof(struct sockaddr_in6)));
p(listen(b, SOMAXCONN));
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists