summaryrefslogtreecommitdiffstats
path: root/sys/netinet/ip_var.h
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/netinet/ip_var.h
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/netinet/ip_var.h')
-rw-r--r--sys/netinet/ip_var.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h
index 00d7a97..239bc73 100644
--- a/sys/netinet/ip_var.h
+++ b/sys/netinet/ip_var.h
@@ -174,7 +174,6 @@ struct inpcb;
struct route;
struct sockopt;
-VNET_DECLARE(uint32_t, ip_id); /* ip packet ctr, for ids */
VNET_DECLARE(int, ip_defttl); /* default IP ttl */
VNET_DECLARE(int, ipforwarding); /* ip forwarding */
#ifdef IPSTEALTH
@@ -228,7 +227,7 @@ struct in_ifaddr *
void ip_savecontrol(struct inpcb *, struct mbuf **, struct ip *,
struct mbuf *);
void ip_slowtimo(void);
-uint16_t ip_randomid(void);
+void ip_fillid(struct ip *);
int rip_ctloutput(struct socket *, struct sockopt *);
void rip_ctlinput(int, struct sockaddr *, void *);
void rip_init(void);
@@ -302,22 +301,6 @@ extern int (*ng_ipfw_input_p)(struct mbuf **, int,
extern int (*ip_dn_ctl_ptr)(struct sockopt *);
extern int (*ip_dn_io_ptr)(struct mbuf **, int, struct ip_fw_args *);
-
-VNET_DECLARE(int, ip_do_randomid);
-#define V_ip_do_randomid VNET(ip_do_randomid)
-static __inline uint16_t
-ip_newid(void)
-{
- uint16_t res;
-
- if (V_ip_do_randomid != 0)
- return (ip_randomid());
- else {
- res = atomic_fetchadd_32(&V_ip_id, 1) & 0xFFFF;
- return (htons(res));
- }
-}
-
#endif /* _KERNEL */
#endif /* !_NETINET_IP_VAR_H_ */
OpenPOWER on IntegriCloud