Fix handling of net.inet.ipsec.dfbit=2 variable.

IP_DF macro is in host bytes order, but ip_off field is in network bytes
order. So, use htons() for correct check.
This commit is contained in:
Andrey V. Elsukov 2016-03-18 09:03:00 +00:00
parent efdd41da26
commit 6f814d0ec1
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297014

View File

@ -441,7 +441,7 @@ ipsec_encap(struct mbuf **mp, struct secasindex *saidx)
setdf = V_ip4_ipsec_dfbit;
break;
default:/* propagate to outer header */
setdf = (ip->ip_off & ntohs(IP_DF)) != 0;
setdf = (ip->ip_off & htons(IP_DF)) != 0;
}
itos = ip->ip_tos;
break;