diff options
author | Bjørn Mork <bjorn@mork.no> | 2015-05-15 10:25:29 +0200 |
---|---|---|
committer | Bjørn Mork <bjorn@mork.no> | 2015-05-15 10:25:29 +0200 |
commit | 13762fce1926efb6b553bf20df256ccf6586f518 (patch) | |
tree | 7ac288e17edd643380c1e18dda5b49d02839fa85 /networking | |
parent | 73e699faf130d0fc0f2f076d95db9dbd7f42a8b6 (diff) |
ripe-atlas-fw: imported version 46704670
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Diffstat (limited to 'networking')
-rw-r--r-- | networking/httppost.c | 2 | ||||
-rw-r--r-- | networking/rptaddrs.c | 27 | ||||
-rw-r--r-- | networking/rptra6.c | 2 | ||||
-rw-r--r-- | networking/sslgetcert.c | 4 | ||||
-rw-r--r-- | networking/telnetd.c | 5 |
5 files changed, 30 insertions, 10 deletions
diff --git a/networking/httppost.c b/networking/httppost.c index 24f1430..03cd72c 100644 --- a/networking/httppost.c +++ b/networking/httppost.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2013 RIPE NCC <atlas@ripe.net> + * Copyright (c) 2011-2014 RIPE NCC <atlas@ripe.net> * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * httppost.c -- Simple program that uses the HTTP POST command */ diff --git a/networking/rptaddrs.c b/networking/rptaddrs.c index 1115559..3285d36 100644 --- a/networking/rptaddrs.c +++ b/networking/rptaddrs.c @@ -1,6 +1,6 @@ /* * rptaddrs.c - * Copyright (c) 2013 RIPE NCC <atlas@ripe.net> + * Copyright (c) 2013-2014 RIPE NCC <atlas@ripe.net> * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ @@ -25,7 +25,7 @@ #define IPV4_STATIC ATLAS_STATUS "/network_v4_static_info.json" #define IPV6_STATIC ATLAS_STATUS "/network_v6_static_info.json" #define DNS_STATIC ATLAS_STATUS "/network_dns_static_info.json" -#define NETWORK_INFO ATLAS_STATUS "/network_info.txt" +#define NETWORK_INFO ATLAS_STATUS "/network_v4_info.txt" #define SAFE_PREFIX_N ATLAS_DATA_NEW @@ -63,7 +63,9 @@ static int rpt_ipv6(char *cache_name, char *out_name, char *opt_atlas, int opt_a static void report(const char *fmt, ...); static void report_err(const char *fmt, ...); -int rptaddrs_main(int argc, char *argv[]) +int rptaddrs_main(int argc, char *argv[]); + +int rptaddrs_main(int argc UNUSED_PARAM, char *argv[]) { int r, need_report; unsigned opt; @@ -277,7 +279,7 @@ static int setup_dhcpv4(FILE *of) { int found; FILE *in_file; - char *value; + const char *value; char line[128]; in_file= fopen(NETWORK_INFO, "r"); @@ -452,6 +454,9 @@ static int setup_ipv6_rpt(FILE *of) continue; } + if (prefix_len == 128) + continue; /* Skip host routes */ + snprintf(dst6in, sizeof(dst6in), "%s:%s:%s:%s:%s:%s:%s:%s", dst6p[0], dst6p[1], dst6p[2], dst6p[3], dst6p[4], dst6p[5], dst6p[6], dst6p[7]); @@ -575,7 +580,7 @@ static int report_line(FILE *of, const char *fn) { FILE *f; char *nl; - char line[256]; + char line[512]; f= fopen(fn, "r"); if (f == NULL) @@ -616,6 +621,7 @@ static int report_line(FILE *of, const char *fn) static int check_cache(char *cache_name) { int r, need_report; + struct stat sb; char filename[80]; char buf1[1024]; @@ -627,6 +633,17 @@ static int check_cache(char *cache_name) need_report= 0; + if (stat(cache_name, &sb) == 0 && + sb.st_mtime < time(NULL) - 30 * 24 * 3600) + { + /* This basically makes sure that this information gets + * reported again when the clock is set for the first time. + * A side effect is that it gets reported once a month if + * nothing changes. + */ + need_report= 1; + } + /* Now check if the new file is different from the cache one */ cache_file= fopen(cache_name, "r"); if (cache_file == NULL) diff --git a/networking/rptra6.c b/networking/rptra6.c index b481252..9499125 100644 --- a/networking/rptra6.c +++ b/networking/rptra6.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 RIPE NCC <atlas@ripe.net> + * Copyright (c) 2013-2014 RIPE NCC <atlas@ripe.net> * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. */ #include "libbb.h" diff --git a/networking/sslgetcert.c b/networking/sslgetcert.c index a443b32..f6378c7 100644 --- a/networking/sslgetcert.c +++ b/networking/sslgetcert.c @@ -1,4 +1,6 @@ -/* Simple SSL client to get server certificates */ +/* Simple SSL client to get server certificates + * Copyright (c) 2014 RIPE NCC <atlas@ripe.net> + */ #include "libbb.h" diff --git a/networking/telnetd.c b/networking/telnetd.c index 778156c..f7fe1db 100644 --- a/networking/telnetd.c +++ b/networking/telnetd.c @@ -2,6 +2,7 @@ /* * Simple telnet server * Bjorn Wesen, Axis Communications AB (bjornw@axis.com) + * Copyright (c) 2014 RIPE NCC <atlas@ripe.net> * * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. * @@ -102,8 +103,8 @@ struct tsession { }; /* Two buffers are directly after tsession in malloced memory. - * Make whole thing fit in 4k */ -enum { BUFSIZE = (4 * 1024 - sizeof(struct tsession)) / 2 }; + * Make whole thing fit in 8k */ +enum { BUFSIZE = (8 * 1024 - sizeof(struct tsession)) / 2 }; #ifdef ATLAS static int equal_sessionid(char *passwd); |