mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-02 03:16:45 +00:00
Fix port endian order
This commit is contained in:
parent
cd67868d2a
commit
3dba4633b7
@ -194,10 +194,10 @@ int reachable_unicast(struct subscriber *subscriber, overlay_interface *interfac
|
|||||||
subscriber->reachable = REACHABLE_DIRECT;
|
subscriber->reachable = REACHABLE_DIRECT;
|
||||||
subscriber->address.sin_family = AF_INET;
|
subscriber->address.sin_family = AF_INET;
|
||||||
subscriber->address.sin_addr = addr;
|
subscriber->address.sin_addr = addr;
|
||||||
subscriber->address.sin_port = port;
|
subscriber->address.sin_port = htons(port);
|
||||||
|
|
||||||
// may be used in tests
|
// may be used in tests
|
||||||
DEBUGF("ADD DIRECT ROUTE TO %s via %s", alloca_tohex_sid(subscriber->sid), inet_ntoa(addr));
|
DEBUGF("ADD DIRECT ROUTE TO %s via %s:%d", alloca_tohex_sid(subscriber->sid), inet_ntoa(addr), port);
|
||||||
|
|
||||||
/* Pre-emptively check if we have their sas in memory, or send a request */
|
/* Pre-emptively check if we have their sas in memory, or send a request */
|
||||||
keyring_find_sas_public(keyring, subscriber->sid);
|
keyring_find_sas_public(keyring, subscriber->sid);
|
||||||
|
@ -278,7 +278,7 @@ int packetOkOverlay(struct overlay_interface *interface,unsigned char *packet, s
|
|||||||
struct sockaddr_in *addr=(struct sockaddr_in *)recvaddr;
|
struct sockaddr_in *addr=(struct sockaddr_in *)recvaddr;
|
||||||
|
|
||||||
// mark this subscriber as reachable directly via unicast.
|
// mark this subscriber as reachable directly via unicast.
|
||||||
reachable_unicast(f.source, interface, addr->sin_addr, addr->sin_port);
|
reachable_unicast(f.source, interface, addr->sin_addr, ntohs(addr->sin_port));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user