Skip to content

Commit

Permalink
Merge 2.6.3 release for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
michel-stam committed Dec 9, 2022
2 parents 7c03fba + 4a33f08 commit 4ffcc7f
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 65 deletions.
3 changes: 2 additions & 1 deletion coreutils/condmv.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ int condmv_main(int argc, char *argv[])
rebased_from, strerror(errno));
goto err;
}
if (fprintf(file, "%s %lu %s\n", opt_add, mytime, from) < 0)
if (fprintf(file, "%s %llu %s\n", opt_add,
(unsigned long long)mytime, from) < 0)
{
fprintf(stderr,
"condmv: unable to append to '%s': %s\n",
Expand Down
7 changes: 4 additions & 3 deletions eperd/condmv.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ static void condmv_start(void *state)

len= strlen(condmvstate->to) + 20;
to= malloc(len);
snprintf(to, len, "%s.%ld", condmvstate->to,
(long)time(NULL)/condmvstate->interval);
snprintf(to, len, "%s.%llu", condmvstate->to,
(unsigned long long)time(NULL)/condmvstate->interval);

crondlog(LVL7 "condmv_start: destination '%s'\n", to);

Expand All @@ -124,7 +124,8 @@ static void condmv_start(void *state)
free(to);
return;
}
if (fprintf(file, "%s %lu %s\n", condmvstate->atlas, mytime,
if (fprintf(file, "%s %llu %s\n", condmvstate->atlas,
(unsigned long long)mytime,
condmvstate->from) < 0)
{
crondlog(LVL9 "condmv: unable to append to '%s': %s\n",
Expand Down
25 changes: 13 additions & 12 deletions eperd/evtdig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,7 @@ static int mk_dns_buff(struct query_state *qry, u_char *packet,
lookup_prepend = xzalloc(DEFAULT_LINE_LENGTH + sizeof(qry->lookupname));
snprintf(lookup_prepend, (sizeof(qry->lookupname) +
DEFAULT_LINE_LENGTH - 1),
"%d.%lu.%s", probe_id, qry->xmit_time,
"%d.%llu.%s", probe_id, (unsigned long long)qry->xmit_time,
qry->lookupname);

qnamelen= ChangetoDnsNameFormat(qname, qnamelen,
Expand Down Expand Up @@ -1679,7 +1679,8 @@ static void tcp_connected(struct tu_env *env, struct bufferevent *bev)
}
else
{
getsockname(bufferevent_getfd(bev), &qry->loc_sin6, &qry->loc_socklen);
getsockname(bufferevent_getfd(bev),
(struct sockaddr *)&qry->loc_sin6, &qry->loc_socklen);
if (qry->response_out)
{
write_response(qry->resp_file, RESP_SOCKNAME,
Expand Down Expand Up @@ -3344,7 +3345,7 @@ static void tdig_stats(int unusg_statsed UNUSED_PARAM, const short event UNUSED_
AS(atlas_get_version_json_str());
AS(", ");
gettimeofday(&now, NULL);
JS1(time, %ld, now.tv_sec);
JS1(time, %llu, (unsigned long long)now.tv_sec);
JU(sok , base->sentok);
JU(rok , base->recvok);
JU(sent , base->sentbytes);
Expand Down Expand Up @@ -3674,7 +3675,7 @@ void printErrorQuick (struct query_state *qry)
fprintf(fh, "RESULT { ");
fprintf(fh, "%s,", atlas_get_version_json_str());
fprintf(fh, "\"id\" : 9202 ,");
fprintf(fh, "\"time\" : %ld ,", atlas_time());
fprintf(fh, "\"time\" : %llu ,", (unsigned long long)atlas_time());

fprintf(fh, "\"error\" : [{ ");
fprintf(fh, "\"query busy\": \"not starting a new one. previous one is not done yet\"}");
Expand All @@ -3684,7 +3685,7 @@ void printErrorQuick (struct query_state *qry)
fprintf(fh, "\"id\" : \"%s\"", qry->str_Atlas);
if (qry->str_bundle)
fprintf(fh, ",\"bundle\" : %s", qry->str_bundle);
fprintf(fh, ",\"start time\" : %ld", qry->xmit_time);
fprintf(fh, ",\"start time\" : %llu", (unsigned long long)qry->xmit_time);
if(qry->retry) {
fprintf(fh, ",\"retry\": %d", qry->retry);

Expand Down Expand Up @@ -3735,7 +3736,7 @@ void printReply(struct query_state *qry, int wire_size, unsigned char *result)
AS(atlas_get_version_json_str());
AS(", ");
if (qry->opt_rset){
JS1(time, %ld, qry->xmit_time);
JS1(time, %llu, (unsigned long long)qry->xmit_time);
JD(lts,lts);
AS("\"resultset\" : [ {");
}
Expand All @@ -3745,7 +3746,7 @@ void printReply(struct query_state *qry, int wire_size, unsigned char *result)
AS (",{");
}

JS1(time, %ld, qry->xmit_time);
JS1(time, %llu, (unsigned long long)qry->xmit_time);
JD(lts,lts);

if (qry->response_in || qry->response_out)
Expand Down Expand Up @@ -4073,7 +4074,7 @@ unsigned char* ReadName(unsigned char *base, size_t size, size_t offset,
/* Bad format */
snprintf((char *)name, sizeof(name),
"format-error at %lu: value 0x%x",
offset, len);
(unsigned long)offset, len);
*count= -1;
free(name); name= NULL;
return name;
Expand All @@ -4084,7 +4085,7 @@ unsigned char* ReadName(unsigned char *base, size_t size, size_t offset,
{
snprintf((char *)name, sizeof(name),
"offset-error at %lu: offset %lu",
offset, noffset);
(unsigned long)offset, (unsigned long)noffset);
*count= -1;
free(name); name= NULL;
return name;
Expand All @@ -4095,7 +4096,7 @@ unsigned char* ReadName(unsigned char *base, size_t size, size_t offset,
/* Too many */
snprintf((char *)name, sizeof(name),
"too many redirects at %lu",
offset);
(unsigned long)offset);
*count= -1;
free(name); name= NULL;
return name;
Expand All @@ -4117,7 +4118,7 @@ unsigned char* ReadName(unsigned char *base, size_t size, size_t offset,
{
snprintf((char *)name, sizeof(name),
"buf-bounds-error at %lu: len %d",
offset, len);
(unsigned long)offset, len);
*count= -1;
free(name); name= NULL;
return name;
Expand All @@ -4127,7 +4128,7 @@ unsigned char* ReadName(unsigned char *base, size_t size, size_t offset,
{
snprintf((char *)name, sizeof(name),
"name-length-error at %lu: len %d",
offset, p+len+1);
(unsigned long)offset, p+len+1);
*count= -1;
free(name); name= NULL;
return name;
Expand Down
11 changes: 6 additions & 5 deletions eperd/httpget.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,10 +861,10 @@ static void report(struct hgstate *state)
fprintf(fh, DBQ(id) ":" DBQ(%s) ", "
"%s, "
DBQ(lts) ":%d, "
DBQ(time) ":%ld, ",
DBQ(time) ":%llu, ",
state->atlas, atlas_get_version_json_str(),
get_timesync(),
state->gstart);
(unsigned long long)state->gstart);
if (state->bundle)
{
fprintf(fh, DBQ(bundle) ":%s, ",
Expand All @@ -884,8 +884,8 @@ static void report(struct hgstate *state)
{
if (state->do_combine)
{
snprintf(line, sizeof(line), DBQ(time) ":%ld, ",
state->start.tv_sec);
snprintf(line, sizeof(line), DBQ(time) ":%llu, ",
(unsigned long long)state->start.tv_sec);
}
else
{
Expand Down Expand Up @@ -2114,7 +2114,8 @@ static void connected(struct tu_env *env, struct bufferevent *bev)
else
{
getsockname(bufferevent_getfd(bev),
&state->loc_sin6, &state->loc_socklen);
(struct sockaddr *)&state->loc_sin6,
&state->loc_socklen);
if (state->response_out)
{
write_response(state->resp_file, RESP_SOCKNAME,
Expand Down
8 changes: 4 additions & 4 deletions eperd/ntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,10 +392,10 @@ static void report(struct ntpstate *state)
fprintf(fh, DBQ(id) ":" DBQ(%s)
", %s"
", " DBQ(lts) ":%d"
", " DBQ(time) ":%ld, ",
", " DBQ(time) ":%llu, ",
state->atlas, atlas_get_version_json_str(),
get_timesync(),
state->starttime);
(unsigned long long)state->starttime);
if (state->bundle)
fprintf(fh, DBQ(bundle) ":%s, ", state->bundle);
}
Expand Down Expand Up @@ -1266,13 +1266,13 @@ static int create_socket(struct ntpstate *state)

len= sizeof(state->loc_sin6);
read_response(state->socket, RESP_SOCKNAME,
&len, &state->loc_sin6);
&len, (struct sockaddr *)&state->loc_sin6);
state->loc_socklen= len;
}
else
{
if (getsockname(state->socket,
&state->loc_sin6,
(struct sockaddr*)&state->loc_sin6,
&state->loc_socklen) == -1)
{
crondlog(DIE9 "getsockname failed");
Expand Down
12 changes: 8 additions & 4 deletions eperd/ping.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,8 @@ static void ping_xmit(struct pingstate *host)
}
else
{
getsockname(host->socket, &host->loc_sin6,
getsockname(host->socket,
(struct sockaddr *)&host->loc_sin6,
&host->loc_socklen);
if (host->resp_file_out)
{
Expand Down Expand Up @@ -742,7 +743,8 @@ static void ping_xmit(struct pingstate *host)
host->include_probe_id);

host->loc_socklen= sizeof(host->loc_sin6);
getsockname(host->socket, &host->loc_sin6, &host->loc_socklen);
getsockname(host->socket, (struct sockaddr *)&host->loc_sin6,
&host->loc_socklen);

if (host->response_in)
{
Expand Down Expand Up @@ -1566,7 +1568,8 @@ static void ping_start2(void *state)
}

if (!pingstate->response_in &&
connect(pingstate->socket, &pingstate->sin6,
connect(pingstate->socket,
(struct sockaddr *)&pingstate->sin6,
pingstate->socklen) == -1)
{
snprintf(line, sizeof(line),
Expand All @@ -1591,7 +1594,8 @@ static void ping_start2(void *state)
}
else
{
getsockname(pingstate->socket, &pingstate->loc_sin6,
getsockname(pingstate->socket,
(struct sockaddr *)&pingstate->loc_sin6,
&pingstate->loc_socklen);
if (pingstate->resp_file_out)
{
Expand Down
13 changes: 7 additions & 6 deletions eperd/sslgetcert.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static void buf_add(struct buf *buf, const void *data, size_t len)
newbuf= malloc(maxsize);
if (!newbuf)
{
fprintf(stderr, "unable to allocate %ld bytes\n", maxsize);
fprintf(stderr, "unable to allocate %ld bytes\n", (long)maxsize);
exit(1);
}

Expand Down Expand Up @@ -1031,9 +1031,9 @@ static void report(struct state *state)
fprintf(fh, DBQ(id) ":" DBQ(%s) ", "
"%s, "
DBQ(lts) ":%d, "
DBQ(time) ":%ld, ",
DBQ(time) ":%llu, ",
state->atlas, atlas_get_version_json_str(),
get_timesync(), state->gstart);
get_timesync(), (unsigned long long)state->gstart);
if (state->bundle)
fprintf(fh, DBQ(bundle) ":%s, ", state->bundle);
}
Expand Down Expand Up @@ -1190,8 +1190,8 @@ static FILE *report_head(struct state *state)
fprintf(fh, DBQ(bundle) ":%s, ", state->bundle);
}

fprintf(fh, "%s" DBQ(time) ":%ld",
state->atlas ? ", " : "", atlas_time());
fprintf(fh, "%s" DBQ(time) ":%llu",
state->atlas ? ", " : "", (unsigned long long)atlas_time());
fprintf(fh, ", " DBQ(dst_name) ":" DBQ(%s) ", "
DBQ(dst_port) ":" DBQ(%s),
state->hostname, state->portname);
Expand Down Expand Up @@ -1806,7 +1806,8 @@ static void connected(struct tu_env *env, struct bufferevent *bev)
else
{
getsockname(bufferevent_getfd(bev),
&state->loc_sin6, &state->loc_socklen);
(struct sockaddr *)&state->loc_sin6,
&state->loc_socklen);
if (state->response_out)
{
write_response(state->resp_file, RESP_SOCKNAME,
Expand Down
10 changes: 5 additions & 5 deletions eperd/traceroute.c
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,12 @@ static void report(struct trtstate *state)
fprintf(fh, DBQ(id) ":" DBQ(%s)
", %s"
", " DBQ(lts) ":%d"
", " DBQ(time) ":%ld"
", " DBQ(endtime) ":%ld, ",
", " DBQ(time) ":%llu"
", " DBQ(endtime) ":%llu, ",
state->atlas, atlas_get_version_json_str(),
get_timesync(),
state->starttime,
(long)atlas_time());
(unsigned long long)state->starttime,
(unsigned long long)atlas_time());
if (state->bundle_id)
fprintf(fh, DBQ(bundle) ":%s, ", state->bundle_id);
}
Expand Down Expand Up @@ -4642,7 +4642,7 @@ static int create_socket(struct trtstate *state, int do_tcp)
{
state->loc_socklen= sizeof(state->loc_sin6);
if (!state->response_in && getsockname(state->socket_icmp,
&state->loc_sin6,
(struct sockaddr *)&state->loc_sin6,
&state->loc_socklen) == -1)
{
crondlog(DIE9 "getsockname failed");
Expand Down
4 changes: 3 additions & 1 deletion include/libbb.h
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ const char* endofname(const char *name) FAST_FUNC;
char *is_prefixed_with(const char *string, const char *key) FAST_FUNC;
char *is_suffixed_with(const char *string, const char *key) FAST_FUNC;

#define ATLAS_MSM_VERSION "2.6.2"
#define ATLAS_MSM_VERSION "2.6.3"

/* What's the best place for this? AA may be atlas_probe.h */
#define ATLAS_HOME "/home/atlas"
Expand All @@ -463,6 +463,7 @@ char *is_suffixed_with(const char *string, const char *key) FAST_FUNC;
#define ATLAS_TIMESYNC_FILE_REL ATLAS_DATA_NEW_REL "/timesync.vol"
#define ATLAS_FUZZING_REL "data"

extern int atlas_unsafe(void);
extern char *rebased_validated_filename(const char *path, const char *prefix);
extern char *rebased_validated_dir(const char *path, const char *prefix);
extern int validate_atlas_id(const char *atlas_id);
Expand All @@ -485,6 +486,7 @@ extern void read_response(int fd, int type, size_t *sizep, void *data);
extern void read_response_file(FILE *file, int type, size_t *sizep,
void *data);
extern void write_response(FILE *file, int type, size_t size, void *data);
extern int rxtxrpt_main(int argc, char *argv[]);

int ndelay_on(int fd) FAST_FUNC;
int ndelay_off(int fd) FAST_FUNC;
Expand Down
2 changes: 1 addition & 1 deletion libbb/atlas_bb64.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int buf_add(struct buf *buf, const void *data, size_t len )
newbuf= malloc(maxsize);
if (!newbuf)
{
fprintf(stderr, "unable to allocate %ld bytes\n", maxsize);
fprintf(stderr, "unable to allocate %ld bytes\n", (long)maxsize);
return (1);
}

Expand Down
2 changes: 2 additions & 0 deletions libbb/route_set_flags.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include <platform.h>
#include <net/route.h>

#include "libbb.h"

static const
IF_NOT_FEATURE_IPV6(uint16_t)
IF_FEATURE_IPV6(unsigned)
Expand Down
4 changes: 0 additions & 4 deletions libevent-2.1.11-stable/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ VERSION_INFO = 7:0:0
# is user-visible, and so we can pretty much guarantee that release
# series won't be binary-compatible.

if INSTALL_LIBEVENT
dist_bin_SCRIPTS = event_rpcgen.py
endif

pkgconfigdir=$(libdir)/pkgconfig
LIBEVENT_PKGCONFIG=libevent.pc libevent_core.pc libevent_extra.pc

Expand Down
4 changes: 2 additions & 2 deletions miscutils/perd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1199,8 +1199,8 @@ static int atlas_run(char *cmdline)
fprintf(fn, "RESULT { ");
if (atlas_id)
fprintf(fn, DBQ(id) ":" DBQ(%s) ", ", atlas_id);
fprintf(fn, "%s, " DBQ(time) ":%d, ",
atlas_get_version_json_str(), time(NULL));
fprintf(fn, "%s, " DBQ(time) ":%llu, ",
atlas_get_version_json_str(), (unsigned long long)time(NULL));
if (reason != NULL)
fprintf(fn, DBQ(reason) ":" DBQ(%s) ", ", reason);
fprintf(fn, DBQ(err) ":%d, " DBQ(cmd) ": \"", r);
Expand Down
Loading

0 comments on commit 4ffcc7f

Please sign in to comment.