Restore handling of PMTU discovery, removed through an unifdef(1)

following the MFV of r254219 into r255332. In addition the 'FreeBSD'
macro was never defined in ipfilter 5.1.2 thus it never would have
been enabled in the first place.

This work is prompted by a general cleanup of the IP Filter code
prompted by working to resolve a PR. More to follow.

MFC after:	1 week
This commit is contained in:
cy 2018-12-01 17:59:41 +00:00
parent 58c3cabfa8
commit 7768e73fbf

View File

@ -85,6 +85,8 @@ static const char rcsid[] = "@(#)$Id$";
#endif
extern int ip_optcopy __P((struct ip *, struct ip *));
VNET_DECLARE(int, path_mtu_discovery);
#define V_path_mtu_discovery VNET(path_mtu_discovery)
# ifdef IPFILTER_M_IPFILTER
MALLOC_DEFINE(M_IPFILTER, "ipfilter", "IP Filter packet filter data structures");
@ -477,11 +479,7 @@ ipf_send_ip(fin, m)
IP_HL_A(ip, sizeof(*oip) >> 2);
ip->ip_tos = oip->ip_tos;
ip->ip_id = fin->fin_ip->ip_id;
#if defined(FreeBSD) && (__FreeBSD_version > 460000)
ip->ip_off = htons(path_mtu_discovery ? IP_DF : 0);
#else
ip->ip_off = 0;
#endif
ip->ip_off = htons(V_path_mtu_discovery ? IP_DF : 0);
ip->ip_ttl = V_ip_defttl;
ip->ip_sum = 0;
break;