mirror of
https://kernel.googlesource.com/pub/scm/network/tftp/tftp-hpa
synced 2025-04-26 01:49:52 +03:00
tftpd: Canonicalize myaddr before address_is_local()
The comparisons for forbidden addresses in address_is_local() only work on canonicalized addresses. Also, work in the case myaddr is NULL (if we ever call it that way...) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
parent
7678ae7f14
commit
b2b34cecc8
1 changed files with 3 additions and 1 deletions
|
@ -255,6 +255,9 @@ myrecvfrom(int s, void *buf, int len, unsigned int flags,
|
|||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
normalize_ip6_compat(myaddr);
|
||||
|
||||
/* If the address is not a valid local address,
|
||||
* then bind to any address...
|
||||
*/
|
||||
|
@ -268,7 +271,6 @@ myrecvfrom(int s, void *buf, int len, unsigned int flags,
|
|||
}
|
||||
}
|
||||
|
||||
normalize_ip6_compat(myaddr);
|
||||
normalize_ip6_compat(from);
|
||||
|
||||
return n;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue