mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-01 00:18:15 +01:00
Submitted by: Jinmei Tatuya, Hajimu Umemoto
Reviewed by: rwatson at freebsd dot org Approved by: rwatson at freebsd dot org MFC after: 1 week Fix the matchlen() function so that it handles the IPv4 (AF_INET) case correctly. Until now it has been treating IPv4 addresses as if they were IPv6 which could lead to corruption errors.
This commit is contained in:
parent
870739f5e6
commit
fd57e549e0
@ -861,8 +861,8 @@ matchlen(src, dst)
|
||||
break;
|
||||
#endif
|
||||
case AF_INET:
|
||||
s = (u_char *)&((struct sockaddr_in6 *)src)->sin6_addr;
|
||||
d = (u_char *)&((struct sockaddr_in6 *)dst)->sin6_addr;
|
||||
s = (u_char *)&((struct sockaddr_in *)src)->sin_addr;
|
||||
d = (u_char *)&((struct sockaddr_in *)dst)->sin_addr;
|
||||
addrlen = sizeof(struct in_addr);
|
||||
lim = s + addrlen;
|
||||
break;
|
||||
|
@ -1028,8 +1028,8 @@ matchlen(src, dst)
|
||||
break;
|
||||
#endif
|
||||
case AF_INET:
|
||||
s = (u_char *)&((struct sockaddr_in6 *)src)->sin6_addr;
|
||||
d = (u_char *)&((struct sockaddr_in6 *)dst)->sin6_addr;
|
||||
s = (u_char *)&((struct sockaddr_in *)src)->sin_addr;
|
||||
d = (u_char *)&((struct sockaddr_in *)dst)->sin_addr;
|
||||
addrlen = sizeof(struct in_addr);
|
||||
lim = s + addrlen;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user