FreeBSD Bugzilla – Attachment 185224 Details for
Bug 221385
v6 mapped v4 addresses not working in 11.1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
Test case to reproduce the problem
test.c (text/x-csrc), 806 bytes, created by
Sebastian Schulze Struchtrup
on 2017-08-10 08:30:58 UTC
(
hide
)
Description:
Test case to reproduce the problem
Filename:
MIME Type:
Creator:
Sebastian Schulze Struchtrup
Created:
2017-08-10 08:30:58 UTC
Size:
806 bytes
patch
obsolete
>#include <stdio.h> >#include <sys/types.h> >#include <sys/socket.h> >#include <arpa/inet.h> >#include <netinet/in.h> > > >int error(const char* op) >{ > perror(op); > return 1; >} > >int main() >{ > int s = socket(PF_INET6, SOCK_STREAM, 0); > if (s == -1) > return error("socket"); > > struct sockaddr_in6 sa; > if (inet_pton(AF_INET6, "::ffff:127.0.0.1", sa.sin6_addr.s6_addr) != 1) > return error("inet_pton"); > >// extra setsockopt() required on 11.1: >// int v6only = 0; >// if (setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, &v6only, sizeof(v6only)) == -1) >// return error("setsockopt IPV6_V6ONLY"); > > sa.sin6_family = AF_INET6; > sa.sin6_port = htons(1234); > sa.sin6_flowinfo = 0; > sa.sin6_scope_id = 0; > > connect(s, &sa, sizeof(sa)); > > perror("connect"); > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 221385
: 185224