Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F5218205
connect-with-dst-opt.c
tuexen (Michael Tuexen)
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Authored By
tuexen
Sep 15 2019, 5:49 PM
2019-09-15 17:49:26 (UTC+0)
Size
917 B
Referenced Files
None
Subscribers
None
connect-with-dst-opt.c
View Options
#include
<sys/types.h>
#include
<sys/socket.h>
#include
<netinet/in.h>
#include
<arpa/inet.h>
#include
<stdlib.h>
#include
<string.h>
#include
<unistd.h>
int
main
(
void
)
{
char
opt
[
128
];
char
buf
[
2048
];
struct
sockaddr_in6
addr
;
int
fd
;
opt
[
0
]
=
IPPROTO_TCP
;
opt
[
1
]
=
(
sizeof
(
opt
)
>>
3
)
-
1
;
opt
[
2
]
=
0x3f
;
opt
[
3
]
=
sizeof
(
opt
)
-
4
;
arc4random_buf
(
opt
+
4
,
sizeof
(
opt
)
-
4
);
memset
(
buf
,
'A'
,
sizeof
(
buf
));
memset
(
&
addr
,
0
,
sizeof
(
addr
));
addr
.
sin6_family
=
AF_INET6
;
addr
.
sin6_len
=
sizeof
(
struct
sockaddr_in6
);
addr
.
sin6_port
=
htons
(
80
);
inet_pton
(
AF_INET6
,
"2a02:c6a0:4015:10::108"
,
&
addr
.
sin6_addr
);
fd
=
socket
(
AF_INET6
,
SOCK_STREAM
,
IPPROTO_TCP
);
connect
(
fd
,
(
const
struct
sockaddr
*
)
&
addr
,
(
socklen_t
)
sizeof
(
struct
sockaddr_in6
));
setsockopt
(
fd
,
IPPROTO_IPV6
,
IPV6_DSTOPTS
,
opt
,
(
socklen_t
)
sizeof
(
opt
));
send
(
fd
,
(
const
void
*
)
buf
,
sizeof
(
buf
),
0
);
sleep
(
1
);
close
(
fd
);
return
(
0
);
}
File Metadata
Details
Attached
Mime Type
text/x-c
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2180078
Default Alt Text
connect-with-dst-opt.c (917 B)
Attached To
Mode
D21666: Let the RACK stack take IP options into account when computing the space for user data in TCP segments
Attached
Detach File
Event Timeline
Log In to Comment