Преглед изворни кода

package: ndisc6: Update to version 1.0.8

Signed-off-by: Phil Sutter <phil@nwl.cc>
Phil Sutter пре 3 недеља
родитељ
комит
886a6d00e1

+ 2 - 2
package/ndisc6/Makefile

@@ -4,9 +4,9 @@
 include ${ADK_TOPDIR}/rules.mk
 
 PKG_NAME:=		ndisc6
-PKG_VERSION:=		1.0.2
+PKG_VERSION:=		1.0.8
 PKG_RELEASE:=		1
-PKG_HASH:=		6acec8a0cb9efa3ac98456f46c3016aeec0598b0c7557c95242b5228ad62ca7a
+PKG_HASH:=		1f2fb2dc1172770aa5a09d39738a44d8b753cc5e2e25e306ca78682f9fea0b4f
 PKG_DESCR:=		icmpv6 neighbour discovery tools
 PKG_SECTION:=		net/ipv6
 PKG_URL:=		http://www.remlab.net/

+ 0 - 20
package/ndisc6/patches/patch-rdnssd_icmp_c

@@ -1,20 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/rdnssd/icmp.c	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/rdnssd/icmp.c	2009-05-10 19:43:19.000000000 +0200
-@@ -47,6 +47,7 @@
- 
- static int icmp_recv (int fd)
- {
-+		struct cmsghdr *cmsg;
- 		struct nd_router_advert icmp6;
- 		uint8_t buf[65536 - sizeof (icmp6)], cbuf[CMSG_SPACE (sizeof (int))];
- 		struct iovec iov[2] =
-@@ -74,7 +75,7 @@ static int icmp_recv (int fd)
- 		 || (icmp6.nd_ra_code != 0)) /* unknown ICMPv6 code */
- 			return -1;
- 
--		for (struct cmsghdr *cmsg = CMSG_FIRSTHDR (&msg);
-+		for (cmsg = CMSG_FIRSTHDR (&msg);
- 		     cmsg != NULL;
- 		     cmsg = CMSG_NXTHDR (&msg, cmsg))
- 		{

+ 0 - 78
package/ndisc6/patches/patch-rdnssd_rdnssd_c

@@ -1,78 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/rdnssd/rdnssd.c	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/rdnssd/rdnssd.c	2009-05-10 19:42:36.000000000 +0200
-@@ -76,6 +76,7 @@ static struct
- 
- static void write_resolv(const char *resolvpath)
- {
-+	size_t i;
- 	FILE *resolv;
- 	int rval;
- 	char tmpfile[strlen(resolvpath) + sizeof(".tmp")];
-@@ -89,7 +90,7 @@ static void write_resolv(const char *res
- 		return;
- 	}
- 
--	for (size_t i = 0; i < servers.count; i++) {
-+	for (i = 0; i < servers.count; i++) {
- 		char addr[INET6_ADDRSTRLEN];
- 		inet_ntop(AF_INET6, &servers.list[i].addr, addr, INET6_ADDRSTRLEN);
- 
-@@ -132,6 +133,7 @@ static int rdnss_older (const void *a, c
- static void rdnss_update (const struct in6_addr *addr, unsigned int ifindex, time_t expiry)
- {
- 	size_t i;
-+	unsigned int j;
- 
- 	/* Does this entry already exist? */
- 	for (i = 0; i < servers.count; i++)
-@@ -165,12 +167,12 @@ static void rdnss_update (const struct i
- 	qsort (servers.list, servers.count, sizeof (rdnss_t), rdnss_older);
- 
- #ifndef NDEBUG
--	for (unsigned i = 0; i < servers.count; i++)
-+	for (j = 0; j < servers.count; j++)
- 	{
- 		char buf[INET6_ADDRSTRLEN];
--		inet_ntop (AF_INET6, &servers.list[i].addr, buf,
-+		inet_ntop (AF_INET6, &servers.list[j].addr, buf,
- 		           sizeof (buf));
--		syslog (LOG_DEBUG, "%u: %48s expires at %u\n", i, buf,
-+		syslog (LOG_DEBUG, "%u: %48s expires at %u\n", j, buf,
- 		        (unsigned)servers.list[i].expiry);
- 	}
- #endif
-@@ -178,6 +180,7 @@ static void rdnss_update (const struct i
- 
- int parse_nd_opts (const struct nd_opt_hdr *opt, size_t opts_len, unsigned int ifindex)
- {
-+	struct in6_addr *addr;
- 	for (; opts_len >= sizeof(struct nd_opt_hdr);
- 	     opts_len -= opt->nd_opt_len << 3,
- 	     opt = (const struct nd_opt_hdr *)
-@@ -206,7 +209,7 @@ int parse_nd_opts (const struct nd_opt_h
- 
- 		lifetime = now + ntohl(rdnss_opt->nd_opt_rdnss_lifetime);
- 
--		for (struct in6_addr *addr = (struct in6_addr *) (rdnss_opt + 1);
-+		for (addr = (struct in6_addr *) (rdnss_opt + 1);
- 		     nd_opt_len >= 2; addr++, nd_opt_len -= 2)
- 			rdnss_update(addr, ifindex, lifetime);
- 
-@@ -255,6 +258,7 @@ static void ignore_handler (int signum)
- 
- static int worker (int pipe, const char *resolvpath, const char *username)
- {
-+	bool ready;
- 	sigset_t emptyset;
- 	int rval = 0, sock = -1;
- 	const rdnss_src_t *src;
-@@ -283,7 +287,7 @@ static int worker (int pipe, const char 
- 
- 	sigemptyset (&emptyset);
- 
--	for (bool ready = false; termsig == 0;)
-+	for (ready = false; termsig == 0;)
- 	{
- 		struct pollfd pfd =
- 			{ .fd = sock,  .events = POLLIN, .revents = 0 };

+ 0 - 21
package/ndisc6/patches/patch-src_addrinfo_c

@@ -1,21 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/src/addrinfo.c	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/src/addrinfo.c	2009-05-10 19:14:46.000000000 +0200
-@@ -53,7 +53,7 @@ gai_perror (int errval, const char *msg)
- static int
- printnames (const char *name, int family, int aflags, int nflags, bool single)
- {
--	struct addrinfo hints, *res;
-+	struct addrinfo hints, *res, *ptr;
- 
- 	memset (&hints, 0, sizeof (hints));
- 	hints.ai_family = family;
-@@ -67,7 +67,7 @@ printnames (const char *name, int family
- 		return -1;
- 	}
- 
--	for (struct addrinfo *ptr = res; ptr != NULL; ptr = ptr->ai_next)
-+	for (ptr = res; ptr != NULL; ptr = ptr->ai_next)
- 	{
- 		char hostname[NI_MAXHOST];
- 

+ 0 - 35
package/ndisc6/patches/patch-src_ndisc_c

@@ -1,35 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/src/ndisc.c	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/src/ndisc.c	2009-05-10 19:16:53.000000000 +0200
-@@ -375,12 +375,13 @@ parseroute (const uint8_t *opt)
- static int
- parserdnss (const uint8_t *opt)
- {
-+	unsigned int i;
- 	uint8_t optlen = opt[1];
- 	if (((optlen & 1) == 0) || (optlen < 3))
- 		return -1;
- 
- 	optlen /= 2;
--	for (unsigned i = 0; i < optlen; i++)
-+	for (i = 0; i < optlen; i++)
- 	{
- 		char str[INET6_ADDRSTRLEN];
- 
-@@ -521,6 +522,7 @@ static ssize_t
- recvfromLL (int fd, void *buf, size_t len, int flags,
-             struct sockaddr_in6 *addr)
- {
-+	struct cmsghdr *cmsg;
- 	char cbuf[CMSG_SPACE (sizeof (int))];
- 	struct iovec iov =
- 	{
-@@ -542,7 +544,7 @@ recvfromLL (int fd, void *buf, size_t le
- 		return val;
- 
- 	/* ensures the hop limit is 255 */
--	for (struct cmsghdr *cmsg = CMSG_FIRSTHDR (&hdr);
-+	for (cmsg = CMSG_FIRSTHDR (&hdr);
- 	     cmsg != NULL;
- 	     cmsg = CMSG_NXTHDR (&hdr, cmsg))
- 	{

+ 0 - 48
package/ndisc6/patches/patch-src_tcpspray_c

@@ -1,48 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/src/tcpspray.c	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/src/tcpspray.c	2009-05-10 19:13:52.000000000 +0200
-@@ -60,7 +60,7 @@ static unsigned verbose = 0;
- 
- static int tcpconnect (const char *host, const char *serv)
- {
--	struct addrinfo hints, *res;
-+	struct addrinfo hints, *res, *p;
- 
- 	memset (&hints, 0, sizeof (hints));
- 	hints.ai_family = family;
-@@ -78,7 +78,7 @@ static int tcpconnect (const char *host,
- 
- 	val = -1;
- 
--	for (struct addrinfo *p = res; (p != NULL) && (val == -1); p = p->ai_next)
-+	for (p = res; (p != NULL) && (val == -1); p = p->ai_next)
- 	{
- 		val = socket (p->ai_family, p->ai_socktype, p->ai_protocol);
- 		if (val == -1)
-@@ -127,6 +127,8 @@ static int
- tcpspray (const char *host, const char *serv, unsigned long n, size_t blen,
-           unsigned delay_us, const char *fillname, bool echo)
- {
-+	unsigned int i, j;
-+
- 	if (serv == NULL)
- 		serv = echo ? "echo" : "discard";
- 
-@@ -172,7 +174,7 @@ tcpspray (const char *host, const char *
- 		switch (child)
- 		{
- 			case 0:
--				for (unsigned i = 0; i < n; i++)
-+				for (i = 0; i < n; i++)
- 				{
- 					ssize_t val = recv (fd, block, blen, MSG_WAITALL);
- 					if (val != (ssize_t)blen)
-@@ -208,7 +210,7 @@ tcpspray (const char *host, const char *
- 	struct timespec start, end;
- 	mono_gettime (&start);
- 
--	for (unsigned i = 0; i < n; i++)
-+	for (j = 0; j < n; j++)
- 	{
- 		ssize_t val = write (fd, block, blen);
- 		if (val != (ssize_t)blen)

+ 0 - 20
package/ndisc6/patches/patch-src_tcptraceroute_c

@@ -1,20 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/src/tcptraceroute.c	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/src/tcptraceroute.c	2009-05-10 19:15:28.000000000 +0200
-@@ -114,6 +114,7 @@ static const char bin_name[] = RLTRACERO
- 
- int main (int argc, char *argv[])
- {
-+	int i;
- 	setlocale (LC_ALL, "");
- 	bindtextdomain (PACKAGE, LOCALEDIR);
- 	textdomain (PACKAGE);
-@@ -130,7 +131,7 @@ int main (int argc, char *argv[])
- 	
- 	/* Prepare big enough buffers */
- 	unsigned len = 0;
--	for (int i = 1; i < argc; i++)
-+	for (i = 1; i < argc; i++)
- 		len += strlen (argv[i]);
- 
- 	char optbuf[3 * len + argc], *buf = optbuf;

+ 0 - 11
package/ndisc6/patches/patch-src_trace-tcp_c

@@ -1,11 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/src/trace-tcp.c	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/src/trace-tcp.c	2009-05-10 19:38:11.000000000 +0200
-@@ -24,6 +24,7 @@
- 
- #undef _GNU_SOURCE
- #define _BSD_SOURCE 1
-+#define __FAVOR_BSD 1
- 
- #include <string.h>
- #include <inttypes.h>

+ 0 - 11
package/ndisc6/patches/patch-src_trace-udp_c

@@ -1,11 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/src/trace-udp.c	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/src/trace-udp.c	2009-05-10 19:38:18.000000000 +0200
-@@ -24,6 +24,7 @@
- 
- #undef _GNU_SOURCE
- #define _BSD_SOURCE 1
-+#define __FAVOR_BSD 1
- 
- #include <string.h>
- #include <stdbool.h>

+ 0 - 128
package/ndisc6/patches/patch-src_traceroute_c

@@ -1,128 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/src/traceroute.c	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/src/traceroute.c	2009-05-10 19:31:06.000000000 +0200
-@@ -149,6 +149,7 @@ static ssize_t
- recv_payload (int fd, void *buf, size_t len,
-               struct sockaddr_in6 *addr, int *hlim)
- {
-+	struct cmsghdr *cmsg;
- 	char cbuf[CMSG_SPACE (sizeof (int))];
- 	struct iovec iov =
- 	{
-@@ -170,7 +171,7 @@ recv_payload (int fd, void *buf, size_t 
- 		return val;
- 
- 	/* ensures the hop limit is 255 */
--	for (struct cmsghdr *cmsg = CMSG_FIRSTHDR (&hdr);
-+	for (cmsg = CMSG_FIRSTHDR (&hdr);
- 	     cmsg != NULL;
- 	     cmsg = CMSG_NXTHDR (&hdr, cmsg))
- 		if ((cmsg->cmsg_level == IPPROTO_IPV6)
-@@ -625,14 +626,16 @@ static void
- display (const tracetest_t *tab, unsigned min_ttl, unsigned max_ttl,
-          unsigned retries)
- {
--	for (unsigned ttl = min_ttl; ttl <= max_ttl; ttl++)
-+	unsigned int ttl, col;
-+
-+	for (ttl = min_ttl; ttl <= max_ttl; ttl++)
- 	{
- 		struct sockaddr_in6 hop = { .sin6_family = AF_UNSPEC };
- 		const tracetest_t *line = tab + retries * (ttl - min_ttl);
- 
- 		printf ("%2d ", ttl);
- 
--		for (unsigned col = 0; col < retries; col++)
-+		for (col = 0; col < retries; col++)
- 		{
- 			const tracetest_t *test = line + col;
- 			if (test->result == TRACE_TIMEOUT)
-@@ -821,6 +824,7 @@ static void setup_socket (int fd)
- 
- static int setsock_rth (int fd, int type, const char **segv, int segc)
- {
-+	int i;
- 	uint8_t hdr[inet6_rth_space (type, segc)];
- 	inet6_rth_init (hdr, sizeof (hdr), type, segc);
- 
-@@ -829,7 +833,7 @@ static int setsock_rth (int fd, int type
- 	hints.ai_family = AF_INET6;
- 	hints.ai_flags = AI_IDN;
- 
--	for (int i = 0; i < segc; i++)
-+	for (i = 0; i < segc; i++)
- 	{
- 		struct addrinfo *res;
- 
-@@ -868,7 +872,8 @@ static struct
- 
- static int prepare_sockets (void)
- {
--	for (unsigned i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
-+	unsigned int i;
-+	for (i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
- 	{
- 		protofd[i].fd = socket (AF_INET6, SOCK_RAW, protofd[i].protocol);
- 		if (protofd[i].fd == -1)
-@@ -883,8 +888,9 @@ static int prepare_sockets (void)
- 
- static int get_socket (int protocol)
- {
-+	unsigned int i;
- 	errno = EPROTONOSUPPORT;
--	for (unsigned i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
-+	for (i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
- 		if (protofd[i].protocol == protocol)
- 		{
- 			int fd = protofd[i].fd;
-@@ -902,7 +908,8 @@ static int get_socket (int protocol)
- 
- static void drop_sockets (void)
- {
--	for (unsigned i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
-+	unsigned int i;
-+	for (i = 0; i < sizeof (protofd) / sizeof (protofd[0]); i++)
- 		if (protofd[i].fd != -1)
- 			close (protofd[i].fd);
- }
-@@ -914,6 +921,8 @@ traceroute (const char *dsthost, const c
-             unsigned timeout, unsigned delay, unsigned retries,
-             size_t packet_len, int min_ttl, int max_ttl)
- {
-+	unsigned int i, j, step, progress;
-+
- 	/* Creates ICMPv6 socket to collect error packets */
- 	int icmpfd = get_socket (IPPROTO_ICMPV6);
- 	if (icmpfd == -1)
-@@ -1020,7 +1029,7 @@ traceroute (const char *dsthost, const c
- 			.filter = f,
- 		};
- 
--		for (unsigned i = 0; i < 4; i++)
-+		for (i = 0; i < 4; i++)
- 		{
- 			/* A = icmp->ip6_dst.s6_addr32[i]; */
- 			pc->code = BPF_LD + BPF_W + BPF_ABS;
-@@ -1076,7 +1085,7 @@ traceroute (const char *dsthost, const c
- 		tracetest_t tab[(1 + max_ttl - min_ttl) * retries];
- 		memset (tab, 0, sizeof (tab));
- 
--		for (unsigned step = 1, progress = 0;
-+		for (step = 1, progress = 0;
- 		     step < (1 + max_ttl - min_ttl) + retries;
- 		     step++)
- 		{
-@@ -1093,10 +1102,10 @@ traceroute (const char *dsthost, const c
- 				mono_nanosleep (&delay_ts);
- 
- 			/* Sends requests */
--			for (unsigned i = 0; i < retries; i++)
-+			for (j = 0; j < retries; j++)
- 			{
--				int attempt = (retries - 1) - i;
--				int hlim = min_ttl + step + i - retries;
-+				int attempt = (retries - 1) - j;
-+				int hlim = min_ttl + step + j - retries;
- 
- 				if ((hlim > max_ttl) || (hlim < min_ttl))
- 					continue;

+ 0 - 26
package/ndisc6/patches/patch-src_traceroute_h

@@ -1,26 +0,0 @@
-$Id: update-patches 24 2008-08-31 14:56:13Z wbx $
---- ndisc6-0.9.8.orig/src/traceroute.h	2008-05-01 14:52:28.000000000 +0200
-+++ ndisc6-0.9.8/src/traceroute.h	2009-05-10 19:23:51.000000000 +0200
-@@ -24,9 +24,9 @@
- typedef ssize_t (*trace_send_t) (int fd, unsigned ttl, unsigned n,
-                                  size_t plen, uint16_t port);
- 
--typedef ssize_t (*trace_parser_t) (const void *restrict data, size_t len,
--                                   int *restrict ttl,
--                                   unsigned *restrict n, uint16_t port);
-+typedef ssize_t (*trace_parser_t) (const void *data, size_t len,
-+                                   int *ttl,
-+                                   unsigned *n, uint16_t port);
- 
- typedef struct tracetype
- {
-@@ -34,7 +34,8 @@ typedef struct tracetype
- 	int protocol;
- 	int checksum_offset;
- 	trace_send_t send_probe;
--	trace_parser_t parse_resp, parse_err;
-+	trace_parser_t parse_resp;
-+	trace_parser_t parse_err;
- } tracetype;
- 
- # ifdef __cplusplus