1 |
hasufell 14/05/23 17:47:52 |
2 |
|
3 |
Added: 02-libuv-0.11.25-tests.patch |
4 |
01-libuv-0.11.25-tests.patch |
5 |
Log: |
6 |
fix tests wrt #510110 |
7 |
|
8 |
(Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key BDEED020) |
9 |
|
10 |
Revision Changes Path |
11 |
1.1 dev-libs/libuv/files/02-libuv-0.11.25-tests.patch |
12 |
|
13 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libuv/files/02-libuv-0.11.25-tests.patch?rev=1.1&view=markup |
14 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libuv/files/02-libuv-0.11.25-tests.patch?rev=1.1&content-type=text/plain |
15 |
|
16 |
Index: 02-libuv-0.11.25-tests.patch |
17 |
=================================================================== |
18 |
From 02c2595fdc259fa15b9a927779cbe65f381f4b26 Mon Sep 17 00:00:00 2001 |
19 |
From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= <saghul@×××××.com> |
20 |
Date: Fri, 23 May 2014 16:36:57 +0200 |
21 |
Subject: [PATCH] unix, windows: define UV__INET/6_ADDRSTRLEN constants |
22 |
|
23 |
--- |
24 |
src/inet.c | 7 +++++-- |
25 |
1 file changed, 5 insertions(+), 2 deletions(-) |
26 |
|
27 |
diff --git a/src/inet.c b/src/inet.c |
28 |
index 9220de6..0eb9438 100644 |
29 |
--- a/src/inet.c |
30 |
+++ b/src/inet.c |
31 |
@@ -27,6 +27,9 @@ |
32 |
#include "uv.h" |
33 |
#include "uv-common.h" |
34 |
|
35 |
+#define UV__INET_ADDRSTRLEN 16 |
36 |
+#define UV__INET6_ADDRSTRLEN 46 |
37 |
+ |
38 |
|
39 |
static int inet_ntop4(const unsigned char *src, char *dst, size_t size); |
40 |
static int inet_ntop6(const unsigned char *src, char *dst, size_t size); |
41 |
@@ -49,7 +52,7 @@ int uv_inet_ntop(int af, const void* src, char* dst, size_t size) { |
42 |
|
43 |
static int inet_ntop4(const unsigned char *src, char *dst, size_t size) { |
44 |
static const char fmt[] = "%u.%u.%u.%u"; |
45 |
- char tmp[sizeof "255.255.255.255"]; |
46 |
+ char tmp[UV__INET_ADDRSTRLEN]; |
47 |
int l; |
48 |
|
49 |
#ifndef _WIN32 |
50 |
@@ -74,7 +77,7 @@ static int inet_ntop6(const unsigned char *src, char *dst, size_t size) { |
51 |
* Keep this in mind if you think this function should have been coded |
52 |
* to use pointer overlays. All the world's not a VAX. |
53 |
*/ |
54 |
- char tmp[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255"], *tp; |
55 |
+ char tmp[UV__INET6_ADDRSTRLEN], *tp; |
56 |
struct { int base, len; } best, cur; |
57 |
unsigned int words[sizeof(struct in6_addr) / sizeof(uint16_t)]; |
58 |
int i; |
59 |
-- |
60 |
1.9.3 |
61 |
|
62 |
|
63 |
|
64 |
|
65 |
1.1 dev-libs/libuv/files/01-libuv-0.11.25-tests.patch |
66 |
|
67 |
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libuv/files/01-libuv-0.11.25-tests.patch?rev=1.1&view=markup |
68 |
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/libuv/files/01-libuv-0.11.25-tests.patch?rev=1.1&content-type=text/plain |
69 |
|
70 |
Index: 01-libuv-0.11.25-tests.patch |
71 |
=================================================================== |
72 |
From f58b02f2cf068e1bed10bf9f632bad396d907de9 Mon Sep 17 00:00:00 2001 |
73 |
From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= <saghul@×××××.com> |
74 |
Date: Fri, 23 May 2014 09:25:23 +0200 |
75 |
Subject: [PATCH] unix, windows: fix parsing scoped IPv6 addresses |
76 |
|
77 |
--- |
78 |
src/inet.c | 37 +++++++++++++++++++++---------------- |
79 |
1 file changed, 21 insertions(+), 16 deletions(-) |
80 |
|
81 |
diff --git a/src/inet.c b/src/inet.c |
82 |
index 0eb9438..36457f4 100644 |
83 |
--- a/src/inet.c |
84 |
+++ b/src/inet.c |
85 |
@@ -17,6 +17,7 @@ |
86 |
|
87 |
#include <stdio.h> |
88 |
#include <string.h> |
89 |
+#include <stdlib.h> |
90 |
|
91 |
#if defined(_MSC_VER) && _MSC_VER < 1600 |
92 |
# include "stdint-msvc2008.h" |
93 |
@@ -159,11 +160,27 @@ static int inet_ntop6(const unsigned char *src, char *dst, size_t size) { |
94 |
|
95 |
|
96 |
int uv_inet_pton(int af, const char* src, void* dst) { |
97 |
+ if (src == NULL || dst == NULL) |
98 |
+ return UV_EINVAL; |
99 |
+ |
100 |
switch (af) { |
101 |
case AF_INET: |
102 |
return (inet_pton4(src, dst)); |
103 |
- case AF_INET6: |
104 |
- return (inet_pton6(src, dst)); |
105 |
+ case AF_INET6: { |
106 |
+ int len; |
107 |
+ char tmp[UV__INET6_ADDRSTRLEN], *s, *p; |
108 |
+ s = (char*) src; |
109 |
+ p = strchr(src, '%'); |
110 |
+ if (p != NULL) { |
111 |
+ s = tmp; |
112 |
+ len = p - src; |
113 |
+ if (len > UV__INET6_ADDRSTRLEN-1) |
114 |
+ len = UV__INET6_ADDRSTRLEN-1; |
115 |
+ memcpy(s, src, len); |
116 |
+ s[len] = '\0'; |
117 |
+ } |
118 |
+ return inet_pton6(s, dst); |
119 |
+ } |
120 |
default: |
121 |
return UV_EAFNOSUPPORT; |
122 |
} |
123 |
@@ -228,7 +245,7 @@ static int inet_pton6(const char *src, unsigned char *dst) { |
124 |
curtok = src; |
125 |
seen_xdigits = 0; |
126 |
val = 0; |
127 |
- while ((ch = *src++) != '\0' && ch != '%') { |
128 |
+ while ((ch = *src++) != '\0') { |
129 |
const char *pch; |
130 |
|
131 |
if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) |
132 |
@@ -259,19 +276,7 @@ static int inet_pton6(const char *src, unsigned char *dst) { |
133 |
continue; |
134 |
} |
135 |
if (ch == '.' && ((tp + sizeof(struct in_addr)) <= endp)) { |
136 |
- int err; |
137 |
- |
138 |
- /* Scope id present, parse ipv4 addr without it */ |
139 |
- pch = strchr(curtok, '%'); |
140 |
- if (pch != NULL) { |
141 |
- char tmp[sizeof "255.255.255.255"]; |
142 |
- |
143 |
- memcpy(tmp, curtok, pch - curtok); |
144 |
- curtok = tmp; |
145 |
- src = pch; |
146 |
- } |
147 |
- |
148 |
- err = inet_pton4(curtok, tp); |
149 |
+ int err = inet_pton4(curtok, tp); |
150 |
if (err == 0) { |
151 |
tp += sizeof(struct in_addr); |
152 |
seen_xdigits = 0; |
153 |
-- |
154 |
1.9.3 |