mirror of
https://github.com/servalproject/serval-dna.git
synced 2024-12-20 21:53:12 +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->address.sin_family = AF_INET;
|
||||
subscriber->address.sin_addr = addr;
|
||||
subscriber->address.sin_port = port;
|
||||
subscriber->address.sin_port = htons(port);
|
||||
|
||||
// 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 */
|
||||
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;
|
||||
|
||||
// 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