-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* jl/virtual: Removed memory leaks from interpolation table uses. Cleaned up git-daemon virtual hosting support.
- v2.8.1
- v2.8.0
- v2.8.0-rc4
- v2.8.0-rc3
- v2.8.0-rc2
- v2.8.0-rc1
- v2.8.0-rc0
- v2.7.4
- v2.7.3
- v2.7.2
- v2.7.1
- v2.7.0
- v2.7.0-rc3
- v2.7.0-rc2
- v2.7.0-rc1
- v2.7.0-rc0
- v2.6.6
- v2.6.5
- v2.6.4
- v2.6.3
- v2.6.2
- v2.6.1
- v2.6.0
- v2.6.0-rc3
- v2.6.0-rc2
- v2.6.0-rc1
- v2.6.0-rc0
- v2.5.5
- v2.5.4
- v2.5.3
- v2.5.2
- v2.5.1
- v2.5.0
- v2.5.0-rc3
- v2.5.0-rc2
- v2.5.0-rc1
- v2.5.0-rc0
- v2.4.11
- v2.4.10
- v2.4.9
- v2.4.8
- v2.4.7
- v2.4.6
- v2.4.5
- v2.4.4
- v2.4.3
- v2.4.2
- v2.4.1
- v2.4.0
- v2.4.0-rc3
- v2.4.0-rc2
- v2.4.0-rc1
- v2.4.0-rc0
- v2.3.10
- v2.3.9
- v2.3.8
- v2.3.7
- v2.3.6
- v2.3.5
- v2.3.4
- v2.3.3
- v2.3.2
- v2.3.1
- v2.3.0
- v2.3.0-rc2
- v2.3.0-rc1
- v2.3.0-rc0
- v2.2.3
- v2.2.2
- v2.2.1
- v2.2.0
- v2.2.0-rc3
- v2.2.0-rc2
- v2.2.0-rc1
- v2.2.0-rc0
- v2.1.4
- v2.1.3
- v2.1.2
- v2.1.1
- v2.1.0
- v2.1.0-rc2
- v2.1.0-rc1
- v2.1.0-rc0
- v2.0.5
- v2.0.4
- v2.0.3
- v2.0.2
- v2.0.1
- v2.0.0
- v2.0.0-rc4
- v2.0.0-rc3
- v2.0.0-rc2
- v2.0.0-rc1
- v2.0.0-rc0
- v1.9.5
- v1.9.4
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.9.0-rc3
- v1.9-rc2
- v1.9-rc1
- v1.9-rc0
- v1.8.5.6
- v1.8.5.5
- v1.8.5.4
- v1.8.5.3
- v1.8.5.2
- v1.8.5.1
- v1.8.5
- v1.8.5-rc3
- v1.8.5-rc2
- v1.8.5-rc1
- v1.8.5-rc0
- v1.8.4.5
- v1.8.4.4
- v1.8.4.3
- v1.8.4.2
- v1.8.4.1
- v1.8.4
- v1.8.4-rc4
- v1.8.4-rc3
- v1.8.4-rc2
- v1.8.4-rc1
- v1.8.4-rc0
- v1.8.3.4
- v1.8.3.3
- v1.8.3.2
- v1.8.3.1
- v1.8.3
- v1.8.3-rc3
- v1.8.3-rc2
- v1.8.3-rc1
- v1.8.3-rc0
- v1.8.2.3
- v1.8.2.2
- v1.8.2.1
- v1.8.2
- v1.8.2-rc3
- v1.8.2-rc2
- v1.8.2-rc1
- v1.8.2-rc0
- v1.8.1.6
- v1.8.1.5
- v1.8.1.4
- v1.8.1.3
- v1.8.1.2
- v1.8.1.1
- v1.8.1
- v1.8.1-rc3
- v1.8.1-rc2
- v1.8.1-rc1
- v1.8.1-rc0
- v1.8.0.3
- v1.8.0.2
- v1.8.0.1
- v1.8.0
- v1.8.0-rc3
- v1.8.0-rc2
- v1.8.0-rc1
- v1.8.0-rc0
- v1.7.12.4
- v1.7.12.3
- v1.7.12.2
- v1.7.12.1
- v1.7.12
- v1.7.12-rc3
- v1.7.12-rc2
- v1.7.12-rc1
- v1.7.12-rc0
- v1.7.11.7
- v1.7.11.6
- v1.7.11.5
- v1.7.11.4
- v1.7.11.3
- v1.7.11.2
- v1.7.11.1
- v1.7.11
- v1.7.11-rc3
- v1.7.11-rc2
- v1.7.11-rc1
- v1.7.11-rc0
- v1.7.10.5
- v1.7.10.4
- v1.7.10.3
- v1.7.10.2
- v1.7.10.1
- v1.7.10
- v1.7.10-rc4
- v1.7.10-rc3
- v1.7.10-rc2
- v1.7.10-rc1
- v1.7.10-r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v1.5.5
- v1.5.5-rc3
- v1.5.5-rc2
- v1.5.5-rc1
- v1.5.5-rc0
- v1.5.4.7
- v1.5.4.6
- v1.5.4.5
- v1.5.4.4
- v1.5.4.3
- v1.5.4.2
- v1.5.4.1
- v1.5.4
- v1.5.4-rc5
- v1.5.4-rc4
- v1.5.4-rc3
- v1.5.4-rc2
- v1.5.4-rc1
- v1.5.4-rc0
- v1.5.3.8
- v1.5.3.7
- v1.5.3.6
- v1.5.3.5
- v1.5.3.4
- v1.5.3.3
- v1.5.3.2
- v1.5.3.1
- v1.5.3
- v1.5.3-rc7
- v1.5.3-rc6
- v1.5.3-rc5
- v1.5.3-rc4
- v1.5.3-rc3
- v1.5.3-rc2
- v1.5.3-rc1
- v1.5.3-rc0
- v1.5.2.5
- v1.5.2.4
- v1.5.2.3
- v1.5.2.2
- v1.5.2.1
- v1.5.2
- v1.5.2-rc3
- v1.5.2-rc2
- v1.5.2-rc1
- v1.5.2-rc0
- v1.5.1.6
- v1.5.1.5
- v1.5.1.4
- v1.5.1.3
- v1.5.1.2
- v1.5.1.1
- v1.5.1
- v1.5.1-rc3
- v1.5.1-rc2
- v1.5.1-rc1
- v1.5.0.7
- v1.5.0.6
- v1.5.0.5
- v1.5.0.4
- v1.5.0.3
- v1.5.0.2
- v1.5.0.1
- v1.5.0
- v1.5.0-rc4
- v1.5.0-rc3
- v1.5.0-rc2
- v1.5.0-rc1
- v1.5.0-rc0
- v1.4.4.5
- v1.4.4.4
- v1.4.4.3
- v1.4.4.2
- v1.4.4.1
- v1.4.4
- v1.4.4-rc2
- v1.4.4-rc1
- v1.4.3.5
- v1.4.3.4
- v1.4.3.3
- v1.4.3.2
- v1.4.3.1
- v1.4.3
- v1.4.3-rc3
- v1.4.3-rc2
- v1.4.3-rc1
Showing
6 changed files
with
436 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,220 @@ | ||
/* | ||
* Copyright (C) 1996-2001 Internet Software Consortium. | ||
* | ||
* Permission to use, copy, modify, and distribute this software for any | ||
* purpose with or without fee is hereby granted, provided that the above | ||
* copyright notice and this permission notice appear in all copies. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM | ||
* DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL | ||
* INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, | ||
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING | ||
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, | ||
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION | ||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
*/ | ||
|
||
#include <errno.h> | ||
#include <sys/types.h> | ||
#include <sys/socket.h> | ||
#include <sys/socket.h> | ||
#include <netinet/in.h> | ||
#include <arpa/inet.h> | ||
#include <stdio.h> | ||
#include <string.h> | ||
|
||
#ifndef NS_INT16SZ | ||
#define NS_INT16SZ 2 | ||
#endif | ||
|
||
#ifndef NS_INADDRSZ | ||
#define NS_INADDRSZ 4 | ||
#endif | ||
|
||
#ifndef NS_IN6ADDRSZ | ||
#define NS_IN6ADDRSZ 16 | ||
#endif | ||
|
||
/* | ||
* WARNING: Don't even consider trying to compile this on a system where | ||
* sizeof(int) < 4. sizeof(int) > 4 is fine; all the world's not a VAX. | ||
*/ | ||
|
||
static int inet_pton4(const char *src, unsigned char *dst); | ||
static int inet_pton6(const char *src, unsigned char *dst); | ||
|
||
/* int | ||
* inet_pton4(src, dst) | ||
* like inet_aton() but without all the hexadecimal and shorthand. | ||
* return: | ||
* 1 if `src' is a valid dotted quad, else 0. | ||
* notice: | ||
* does not touch `dst' unless it's returning 1. | ||
* author: | ||
* Paul Vixie, 1996. | ||
*/ | ||
static int | ||
inet_pton4(const char *src, unsigned char *dst) | ||
{ | ||
static const char digits[] = "0123456789"; | ||
int saw_digit, octets, ch; | ||
unsigned char tmp[NS_INADDRSZ], *tp; | ||
|
||
saw_digit = 0; | ||
octets = 0; | ||
*(tp = tmp) = 0; | ||
while ((ch = *src++) != '\0') { | ||
const char *pch; | ||
|
||
if ((pch = strchr(digits, ch)) != NULL) { | ||
unsigned int new = *tp * 10 + (pch - digits); | ||
|
||
if (new > 255) | ||
return (0); | ||
*tp = new; | ||
if (! saw_digit) { | ||
if (++octets > 4) | ||
return (0); | ||
saw_digit = 1; | ||
} | ||
} else if (ch == '.' && saw_digit) { | ||
if (octets == 4) | ||
return (0); | ||
*++tp = 0; | ||
saw_digit = 0; | ||
} else | ||
return (0); | ||
} | ||
if (octets < 4) | ||
return (0); | ||
memcpy(dst, tmp, NS_INADDRSZ); | ||
return (1); | ||
} | ||
|
||
/* int | ||
* inet_pton6(src, dst) | ||
* convert presentation level address to network order binary form. | ||
* return: | ||
* 1 if `src' is a valid [RFC1884 2.2] address, else 0. | ||
* notice: | ||
* (1) does not touch `dst' unless it's returning 1. | ||
* (2) :: in a full address is silently ignored. | ||
* credit: | ||
* inspired by Mark Andrews. | ||
* author: | ||
* Paul Vixie, 1996. | ||
*/ | ||
|
||
#ifndef NO_IPV6 | ||
static int | ||
inet_pton6(const char *src, unsigned char *dst) | ||
{ | ||
static const char xdigits_l[] = "0123456789abcdef", | ||
xdigits_u[] = "0123456789ABCDEF"; | ||
unsigned char tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; | ||
const char *xdigits, *curtok; | ||
int ch, saw_xdigit; | ||
unsigned int val; | ||
|
||
memset((tp = tmp), '\0', NS_IN6ADDRSZ); | ||
endp = tp + NS_IN6ADDRSZ; | ||
colonp = NULL; | ||
/* Leading :: requires some special handling. */ | ||
if (*src == ':') | ||
if (*++src != ':') | ||
return (0); | ||
curtok = src; | ||
saw_xdigit = 0; | ||
val = 0; | ||
while ((ch = *src++) != '\0') { | ||
const char *pch; | ||
|
||
if ((pch = strchr((xdigits = xdigits_l), ch)) == NULL) | ||
pch = strchr((xdigits = xdigits_u), ch); | ||
if (pch != NULL) { | ||
val <<= 4; | ||
val |= (pch - xdigits); | ||
if (val > 0xffff) | ||
return (0); | ||
saw_xdigit = 1; | ||
continue; | ||
} | ||
if (ch == ':') { | ||
curtok = src; | ||
if (!saw_xdigit) { | ||
if (colonp) | ||
return (0); | ||
colonp = tp; | ||
continue; | ||
} | ||
if (tp + NS_INT16SZ > endp) | ||
return (0); | ||
*tp++ = (unsigned char) (val >> 8) & 0xff; | ||
*tp++ = (unsigned char) val & 0xff; | ||
saw_xdigit = 0; | ||
val = 0; | ||
continue; | ||
} | ||
if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && | ||
inet_pton4(curtok, tp) > 0) { | ||
tp += NS_INADDRSZ; | ||
saw_xdigit = 0; | ||
break; /* '\0' was seen by inet_pton4(). */ | ||
} | ||
return (0); | ||
} | ||
if (saw_xdigit) { | ||
if (tp + NS_INT16SZ > endp) | ||
return (0); | ||
*tp++ = (unsigned char) (val >> 8) & 0xff; | ||
*tp++ = (unsigned char) val & 0xff; | ||
} | ||
if (colonp != NULL) { | ||
/* | ||
* Since some memmove()'s erroneously fail to handle | ||
* overlapping regions, we'll do the shift by hand. | ||
*/ | ||
const int n = tp - colonp; | ||
int i; | ||
|
||
for (i = 1; i <= n; i++) { | ||
endp[- i] = colonp[n - i]; | ||
colonp[n - i] = 0; | ||
} | ||
tp = endp; | ||
} | ||
if (tp != endp) | ||
return (0); | ||
memcpy(dst, tmp, NS_IN6ADDRSZ); | ||
return (1); | ||
} | ||
#endif | ||
|
||
/* int | ||
* isc_net_pton(af, src, dst) | ||
* convert from presentation format (which usually means ASCII printable) | ||
* to network format (which is usually some kind of binary format). | ||
* return: | ||
* 1 if the address was valid for the specified address family | ||
* 0 if the address wasn't valid (`dst' is untouched in this case) | ||
* -1 if some other error occurred (`dst' is untouched in this case, too) | ||
* author: | ||
* Paul Vixie, 1996. | ||
*/ | ||
int | ||
inet_pton(int af, const char *src, void *dst) | ||
{ | ||
switch (af) { | ||
case AF_INET: | ||
return (inet_pton4(src, dst)); | ||
#ifndef NO_IPV6 | ||
case AF_INET6: | ||
return (inet_pton6(src, dst)); | ||
#endif | ||
default: | ||
errno = EAFNOSUPPORT; | ||
return (-1); | ||
} | ||
/* NOTREACHED */ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters