mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-30 08:03:49 +00:00
Harmonising edits so that it builds again.
This commit is contained in:
parent
b402aba22d
commit
7c4f07279b
3
mphlr.h
3
mphlr.h
@ -772,7 +772,8 @@ int overlay_route_saw_selfannounce(int interface,overlay_frame *f,long long now)
|
||||
overlay_node *overlay_route_find_node(unsigned char *sid,int createP);
|
||||
unsigned int overlay_route_hash_sid(unsigned char *sid);
|
||||
int overlay_route_init(int mb_ram);
|
||||
overlay_neighbour *overlay_route_get_neighbour_structure(unsigned char *packed_sid);
|
||||
overlay_neighbour *overlay_route_get_neighbour_structure(unsigned char *packed_sid,
|
||||
int createP);
|
||||
unsigned char *overlay_get_my_sid();
|
||||
int overlay_frame_set_me_as_source(overlay_frame *f);
|
||||
int overlay_frame_set_neighbour_as_source(overlay_frame *f,overlay_neighbour *n);
|
||||
|
@ -57,7 +57,7 @@ int overlay_frame_package_fmt1(overlay_frame *p,overlay_buffer *b)
|
||||
int fail=0;
|
||||
|
||||
if (p->nexthop_address_status!=OA_RESOLVED) {
|
||||
if (overlay_get_nexthop((unsigned char *)p->destination,p->nexthop,&nexthoplen)) fail++;
|
||||
if (overlay_get_nexthop((unsigned char *)p->destination,p->nexthop,&nexthoplen,&p->nexthop_interface)) fail++;
|
||||
else p->nexthop_address_status=OA_RESOLVED;
|
||||
}
|
||||
|
||||
|
@ -336,6 +336,7 @@ int overlay_route_init(int mb_ram)
|
||||
int overlay_get_nexthop(unsigned char *d,unsigned char *nexthop,int *nexthoplen,
|
||||
int *interface)
|
||||
{
|
||||
int i;
|
||||
if (!overlay_neighbours) return 0;
|
||||
|
||||
overlay_neighbour *neh=overlay_route_get_neighbour_structure(d,0 /* don't create if
|
||||
@ -352,7 +353,7 @@ int overlay_get_nexthop(unsigned char *d,unsigned char *nexthop,int *nexthoplen,
|
||||
*interface=0;
|
||||
for(i=1;i<OVERLAY_MAX_INTERFACES;i++)
|
||||
if (neh->scores[i]>neh->scores[*interface]) *interface=i;
|
||||
if (neg->scores[*interface]<1) return WHY("No open path to node");
|
||||
if (neh->scores[*interface]<1) return WHY("No open path to node");
|
||||
return 0;
|
||||
} else {
|
||||
/* Is not a direct neighbour */
|
||||
@ -629,7 +630,7 @@ int overlay_route_saw_selfannounce(int interface,overlay_frame *f,long long now)
|
||||
{
|
||||
unsigned int s1,s2;
|
||||
unsigned char sender_interface;
|
||||
overlay_neighbour *n=overlay_route_get_neighbour_structure(f->source);
|
||||
overlay_neighbour *n=overlay_route_get_neighbour_structure(f->source,1 /* make neighbour if not yet one */);
|
||||
|
||||
if (!n) return WHY("overlay_route_get_neighbour_structure() failed");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user