fix sin_port = 53 when it should be network order
(note that it doesn't actually matter because we only use this for a source ip lookup)
Test: builds
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: Id508345a702bfff63d42cadc68355b94988edb5a
diff --git a/config.c b/config.c
index f84a61f..c370770 100644
--- a/config.c
+++ b/config.c
@@ -234,7 +234,7 @@
// Attempt to connect to the address. If the connection succeeds and getsockname returns the same
// the address then the address is already assigned to the system and we can't use it.
- struct sockaddr_in sin = { .sin_family = AF_INET, .sin_addr = { addr }, .sin_port = 53 };
+ struct sockaddr_in sin = { .sin_family = AF_INET, .sin_addr = { addr }, .sin_port = htons(53) };
socklen_t len = sizeof(sin);
int inuse = connect(s, (struct sockaddr *)&sin, sizeof(sin)) == 0 &&
getsockname(s, (struct sockaddr *)&sin, &len) == 0 && (size_t)len >= sizeof(sin) &&