mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-21 17:56:47 +00:00
Fix minor compilation issues on CentOS.
- ensure size_t is defined when compiling xprintf.h - declare overlay_route_record as a union field in overlay_route_record to avoid alignment issues - set the result of fwrite and fputs - support slightly older git version
This commit is contained in:
parent
fd0b7eda59
commit
bcd9575b54
@ -106,7 +106,10 @@ struct overlay_mdp_data_frame {
|
|||||||
uint16_t payload_length;
|
uint16_t payload_length;
|
||||||
int queue;
|
int queue;
|
||||||
int ttl;
|
int ttl;
|
||||||
unsigned char payload[MDP_MTU-100];
|
union{
|
||||||
|
unsigned char payload[MDP_MTU-100];
|
||||||
|
struct overlay_route_record route_record;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
struct overlay_mdp_error {
|
struct overlay_mdp_error {
|
||||||
|
@ -459,7 +459,7 @@ static int app_route_print(const struct cli_parsed *parsed, struct cli_context *
|
|||||||
|
|
||||||
int ofs=0;
|
int ofs=0;
|
||||||
while(ofs + sizeof(struct overlay_route_record) <= rx.out.payload_length){
|
while(ofs + sizeof(struct overlay_route_record) <= rx.out.payload_length){
|
||||||
struct overlay_route_record *p=(struct overlay_route_record *)&rx.out.payload[ofs];
|
struct overlay_route_record *p=&rx.out.route_record;
|
||||||
ofs+=sizeof(struct overlay_route_record);
|
ofs+=sizeof(struct overlay_route_record);
|
||||||
|
|
||||||
if (p->reachable==REACHABLE_NONE)
|
if (p->reachable==REACHABLE_NONE)
|
||||||
|
@ -1145,7 +1145,7 @@ static int routing_table(struct subscriber *subscriber, void *context)
|
|||||||
overlay_mdp_frame reply;
|
overlay_mdp_frame reply;
|
||||||
bzero(&reply, sizeof(overlay_mdp_frame));
|
bzero(&reply, sizeof(overlay_mdp_frame));
|
||||||
|
|
||||||
struct overlay_route_record *r=(struct overlay_route_record *)&reply.out.payload;
|
struct overlay_route_record *r=&reply.out.route_record;
|
||||||
reply.packetTypeAndFlags=MDP_TX;
|
reply.packetTypeAndFlags=MDP_TX;
|
||||||
reply.out.payload_length=sizeof(struct overlay_route_record);
|
reply.out.payload_length=sizeof(struct overlay_route_record);
|
||||||
r->sid = subscriber->sid;
|
r->sid = subscriber->sid;
|
||||||
|
@ -113,8 +113,8 @@ int main(int argc, char **argv)
|
|||||||
unsigned remain = size - offset - 1;
|
unsigned remain = size - offset - 1;
|
||||||
if (remain > sizeof buf)
|
if (remain > sizeof buf)
|
||||||
remain = sizeof buf;
|
remain = sizeof buf;
|
||||||
fwrite(buf, remain, 1, stdout);
|
int r=fwrite(buf, remain, 1, stdout);
|
||||||
fputc('\n', stdout);
|
r=fputc('\n', stdout);
|
||||||
offset += remain + 1;
|
offset += remain + 1;
|
||||||
if (bounce <= n || bounce >= bouncemax)
|
if (bounce <= n || bounce >= bouncemax)
|
||||||
bouncedelta *= -1;
|
bouncedelta *= -1;
|
||||||
|
@ -154,7 +154,7 @@ case "$error" in
|
|||||||
*[Nn]'o tags can describe'* | \
|
*[Nn]'o tags can describe'* | \
|
||||||
*[Cc]'annot describe'* )
|
*[Cc]'annot describe'* )
|
||||||
if [ -n "$default_tag" ]; then
|
if [ -n "$default_tag" ]; then
|
||||||
commit=$(git rev-list --abbrev-commit --max-count 1 ${refspec:-HEAD})
|
commit=$(git rev-list --abbrev-commit --max-count=1 ${refspec:-HEAD})
|
||||||
count=$(( $(git rev-list ${refspec:-HEAD} | wc -l) - 1 ))
|
count=$(( $(git rev-list ${refspec:-HEAD} | wc -l) - 1 ))
|
||||||
echo "$default_tag-$count-g$commit$dirty"
|
echo "$default_tag-$count-g$commit$dirty"
|
||||||
exit 0
|
exit 0
|
||||||
|
@ -62,6 +62,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
typedef void CONTEXT_VPRINTF(void *context, const char *fmt, va_list);
|
typedef void CONTEXT_VPRINTF(void *context, const char *fmt, va_list);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user