-
Notifications
You must be signed in to change notification settings - Fork 0
/
ns3-pquic.patch
91 lines (83 loc) · 3.86 KB
/
ns3-pquic.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
diff --git a/picoquic/picosocks.c b/picoquic/picosocks.c
index 29e2833..3f7b6bb 100644
--- a/picoquic/picosocks.c
+++ b/picoquic/picosocks.c
@@ -53,7 +53,7 @@ static int bind_to_port(SOCKET_TYPE fd, int af, int port)
int picoquic_open_server_sockets(picoquic_server_sockets_t* sockets, int port)
{
int ret = 0;
- const int sock_af[] = { AF_INET6, AF_INET };
+ const int sock_af[] = { AF_INET };
for (int i = 0; i < PICOQUIC_NB_SERVER_SOCKETS; i++) {
if (ret == 0) {
@@ -85,7 +85,7 @@ int picoquic_open_server_sockets(picoquic_server_sockets_t* sockets, int port)
}
if (ret == 0) {
val = 1;
- ret = setsockopt(sockets->s_socket[i], IPPROTO_IPV6, IPV6_DONTFRAG, &val, sizeof(val));
+ ret = setsockopt(sockets->s_socket[i], IPPROTO_IPV6, 62, &val, sizeof(val));
}
}
else {
@@ -641,7 +641,7 @@ int picoquic_send_through_server_sockets(
const char* bytes, int length)
{
/* Both Linux and Windows use separate sockets for V4 and V6 */
- int socket_index = (addr_dest->sa_family == AF_INET) ? 1 : 0;
+ int socket_index = 0;
int sent = picoquic_sendmsg(sockets->s_socket[socket_index], addr_dest, dest_length,
addr_from, from_length, from_if, bytes, length);
diff --git a/picoquic/picosocks.h b/picoquic/picosocks.h
index 74cc6ad..81fd01a 100644
--- a/picoquic/picosocks.h
+++ b/picoquic/picosocks.h
@@ -105,7 +105,7 @@
#include "picoquic_internal.h"
-#define PICOQUIC_NB_SERVER_SOCKETS 2
+#define PICOQUIC_NB_SERVER_SOCKETS 1
typedef struct st_picoquic_server_sockets_t {
SOCKET_TYPE s_socket[PICOQUIC_NB_SERVER_SOCKETS];
diff --git a/picoquicfirst/picoquicdemo.c b/picoquicfirst/picoquicdemo.c
index 4c75958..2bb792b 100644
--- a/picoquicfirst/picoquicdemo.c
+++ b/picoquicfirst/picoquicdemo.c
@@ -582,7 +582,7 @@ int quic_server(const char* server_name, int server_port,
/* QDC: I hate having those lines here... But it is the only place to hook before sending... */
/* Both Linux and Windows use separate sockets for V4 and V6 */
- int socket_index = (peer_addr->sa_family == AF_INET) ? 1 : 0;
+ int socket_index = 0;
picoquic_before_sending_packet(cnx_next, server_sockets.s_socket[socket_index]);
(void)picoquic_send_through_server_sockets(&server_sockets,
@@ -903,14 +903,14 @@ int quic_client(const char* ip_address_text, int server_port, const char * sni,
if (ret == 0) {
/* Make the most possible flexible socket */
- fd = socket(/*server_address.ss_family*/AF_INET6, SOCK_DGRAM, IPPROTO_UDP);
+ fd = socket(/*server_address.ss_family*/AF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (fd == INVALID_SOCKET) {
ret = -1;
} else {
int val = 1;
- ret = setsockopt(fd, IPPROTO_IPV6, IPV6_DONTFRAG, &val, sizeof(val));
+ ret = setsockopt(fd, IPPROTO_IPV6, 62, &val, sizeof(val));
if (ret != 0) {
- perror("setsockopt IPV6_DONTFRAG");
+ perror("setsockopt 62");
}
}
}
diff --git a/picoquicfirst/picoquicvpn.c b/picoquicfirst/picoquicvpn.c
index 2f5618a..b408216 100644
--- a/picoquicfirst/picoquicvpn.c
+++ b/picoquicfirst/picoquicvpn.c
@@ -757,9 +757,9 @@ int quic_client(const char* ip_address_text, int server_port, const char * sni,
ret = -1;
} else {
int val = 1;
- ret = setsockopt(fd, IPPROTO_IPV6, IPV6_DONTFRAG, &val, sizeof(val));
+ ret = setsockopt(fd, IPPROTO_IPV6, 62, &val, sizeof(val));
if (ret != 0) {
- perror("setsockopt IPV6_DONTFRAG");
+ perror("setsockopt 62");
}
}
}