summaryrefslogtreecommitdiff
path: root/package/ndisc/patches/patch-rdnssd_rdnssd_c
diff options
context:
space:
mode:
authorwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
committerwbx <wbx@hydrogenium.(none)>2009-05-17 14:41:34 +0200
commit219a6dab8995aad9ac4860cc1a84d6f3509a03a4 (patch)
treeb9c0f3c43aebba2fcfef777592d0add39f2072f4 /package/ndisc/patches/patch-rdnssd_rdnssd_c
Initial import
Diffstat (limited to 'package/ndisc/patches/patch-rdnssd_rdnssd_c')
-rw-r--r--package/ndisc/patches/patch-rdnssd_rdnssd_c78
1 files changed, 78 insertions, 0 deletions
diff --git a/package/ndisc/patches/patch-rdnssd_rdnssd_c b/package/ndisc/patches/patch-rdnssd_rdnssd_c
new file mode 100644
index 000000000..48a261495
--- /dev/null
+++ b/package/ndisc/patches/patch-rdnssd_rdnssd_c
@@ -0,0 +1,78 @@
+$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 };