mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Revert r306186 ("Adjust the sopt_val pointer on bigendian systems").
This logic doesn't work with bigger sopt_valsize (e.g. when ipfw passing 2048 bytes rule). Reported by: adrian Sponsored by: DARPA, AFRL
This commit is contained in:
parent
bba39b9ae3
commit
dd7d4f199e
1 changed files with 1 additions and 5 deletions
|
|
@ -2455,12 +2455,8 @@ sooptcopyin(struct sockopt *sopt, void *buf, size_t len, size_t minlen)
|
|||
*/
|
||||
if ((valsize = sopt->sopt_valsize) < minlen)
|
||||
return EINVAL;
|
||||
if (valsize > len) {
|
||||
#if _BYTE_ORDER == _BIG_ENDIAN
|
||||
sopt->sopt_val = (void *)((uintptr_t)sopt->sopt_val + (valsize - len));
|
||||
#endif
|
||||
if (valsize > len)
|
||||
sopt->sopt_valsize = valsize = len;
|
||||
}
|
||||
|
||||
if (sopt->sopt_td != NULL)
|
||||
return (copyin(sopt->sopt_val, buf, valsize));
|
||||
|
|
|
|||
Loading…
Reference in a new issue