summaryrefslogtreecommitdiff
path: root/net/dns.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-07-06 15:46:38 -0400
committerTom Rini <trini@konsulko.com>2020-07-06 15:46:38 -0400
commit6e7d7aa2e2062995c1cbc3af81cf40c04c50ad30 (patch)
tree3c560d567a76e9850e0195fb892d7e1fbaeed198 /net/dns.c
parent2f5fbb5b39f7b67044dda5c35e4a4b31685a3109 (diff)
parent621e09cb3bf7e6d4fce9dd5e6de97e057adebc3a (diff)
Merge branch 'next'
Merge all outstanding changes from the current next branch in now that we have released.
Diffstat (limited to 'net/dns.c')
-rw-r--r--net/dns.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/net/dns.c b/net/dns.c
index e35c4dca7c..5b1fe5b010 100644
--- a/net/dns.c
+++ b/net/dns.c
@@ -36,6 +36,16 @@ char *net_dns_env_var; /* The envvar to store the answer in */
static int dns_our_port;
+/*
+ * make port a little random (1024-17407)
+ * This keeps the math somewhat trivial to compute, and seems to work with
+ * all supported protocols/clients/servers
+ */
+static unsigned int random_port(void)
+{
+ return 1024 + (get_timer(0) % 0x4000);
+}
+
static void dns_send(void)
{
struct header *header;