summaryrefslogtreecommitdiffstats
path: root/sys/netpfil/pf
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2015-04-01 22:26:39 +0000
committerglebius <glebius@FreeBSD.org>2015-04-01 22:26:39 +0000
commit7c22152af091019b561635382376674c061d3e84 (patch)
tree8b00e7a494687331ff2fc1bd6aa72facdfb91310 /sys/netpfil/pf
parent0b17a7a51280703aa776930b14f0bec4020f5e55 (diff)
downloadFreeBSD-src-7c22152af091019b561635382376674c061d3e84.zip
FreeBSD-src-7c22152af091019b561635382376674c061d3e84.tar.gz
o Use new function ip_fillid() in all places throughout the kernel,
where we want to create a new IP datagram. o Add support for RFC6864, which allows to set IP ID for atomic IP datagrams to any value, to improve performance. The behaviour is controlled by net.inet.ip.rfc6864 sysctl knob, which is enabled by default. o In case if we generate IP ID, use counter(9) to improve performance. o Gather all code related to IP ID into ip_id.c. Differential Revision: https://reviews.freebsd.org/D2177 Reviewed by: adrian, cy, rpaulo Tested by: Emeric POUPON <emeric.poupon stormshield.eu> Sponsored by: Netflix Sponsored by: Nginx, Inc. Relnotes: yes
Diffstat (limited to 'sys/netpfil/pf')
-rw-r--r--sys/netpfil/pf/if_pfsync.c2
-rw-r--r--sys/netpfil/pf/pf_norm.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/netpfil/pf/if_pfsync.c b/sys/netpfil/pf/if_pfsync.c
index e23d2e0..3d62cf5 100644
--- a/sys/netpfil/pf/if_pfsync.c
+++ b/sys/netpfil/pf/if_pfsync.c
@@ -1538,7 +1538,7 @@ pfsync_sendout(int schedswi)
offset = sizeof(*ip);
ip->ip_len = htons(m->m_pkthdr.len);
- ip->ip_id = htons(ip_randomid());
+ ip_fillid(ip);
/* build the pfsync header */
ph = (struct pfsync_header *)(m->m_data + offset);
diff --git a/sys/netpfil/pf/pf_norm.c b/sys/netpfil/pf/pf_norm.c
index 01c0958..5ffb86d 100644
--- a/sys/netpfil/pf/pf_norm.c
+++ b/sys/netpfil/pf/pf_norm.c
@@ -2271,9 +2271,9 @@ pf_scrub_ip(struct mbuf **m0, u_int32_t flags, u_int8_t min_ttl, u_int8_t tos)
/* random-id, but not for fragments */
if (flags & PFRULE_RANDOMID && !(h->ip_off & ~htons(IP_DF))) {
- u_int16_t ip_id = h->ip_id;
+ uint16_t ip_id = h->ip_id;
- h->ip_id = ip_randomid();
+ ip_fillid(h);
h->ip_sum = pf_cksum_fixup(h->ip_sum, ip_id, h->ip_id, 0);
}
}
OpenPOWER on IntegriCloud