diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/dns.c | 10 | ||||
-rw-r--r-- | net/net.c | 14 |
2 files changed, 10 insertions, 14 deletions
diff --git a/net/dns.c b/net/dns.c index e35c4dca7c5..5b1fe5b0103 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; diff --git a/net/net.c b/net/net.c index 11683dd6d09..1e7f633cb69 100644 --- a/net/net.c +++ b/net/net.c @@ -1564,20 +1564,6 @@ int net_parse_bootfile(struct in_addr *ipaddr, char *filename, int max_len) return 1; } -#if defined(CONFIG_CMD_NFS) || \ - defined(CONFIG_CMD_SNTP) || \ - defined(CONFIG_CMD_DNS) -/* - * 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 - */ -unsigned int random_port(void) -{ - return 1024 + (get_timer(0) % 0x4000); -} -#endif - void ip_to_string(struct in_addr x, char *s) { x.s_addr = ntohl(x.s_addr); |