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

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;