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
@ -2455,12 +2455,8 @@ sooptcopyin(struct sockopt *sopt, void *buf, size_t len, size_t minlen)
|
|||||||
*/
|
*/
|
||||||
if ((valsize = sopt->sopt_valsize) < minlen)
|
if ((valsize = sopt->sopt_valsize) < minlen)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
if (valsize > len) {
|
if (valsize > len)
|
||||||
#if _BYTE_ORDER == _BIG_ENDIAN
|
|
||||||
sopt->sopt_val = (void *)((uintptr_t)sopt->sopt_val + (valsize - len));
|
|
||||||
#endif
|
|
||||||
sopt->sopt_valsize = valsize = len;
|
sopt->sopt_valsize = valsize = len;
|
||||||
}
|
|
||||||
|
|
||||||
if (sopt->sopt_td != NULL)
|
if (sopt->sopt_td != NULL)
|
||||||
return (copyin(sopt->sopt_val, buf, valsize));
|
return (copyin(sopt->sopt_val, buf, valsize));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user