diff options
author | melifaro <melifaro@FreeBSD.org> | 2012-10-10 19:06:11 +0000 |
---|---|---|
committer | melifaro <melifaro@FreeBSD.org> | 2012-10-10 19:06:11 +0000 |
commit | 02e40e1b73cf03bfc9521cfc48e93e132d2e9596 (patch) | |
tree | eadfb79e4a7a03342694f5708e28ff1340981a5c /sys/netinet/ip_var.h | |
parent | 9e15eadd181311f674215ea14e508faa724685b0 (diff) | |
download | FreeBSD-src-02e40e1b73cf03bfc9521cfc48e93e132d2e9596.zip FreeBSD-src-02e40e1b73cf03bfc9521cfc48e93e132d2e9596.tar.gz |
Do not check if found IPv4 rte is dynamic if net.inet.icmp.drop_redirect is
enabled. This eliminates one mtx_lock() per each routing lookup thus improving
performance in several cases (routing to directly connected interface or routing
to default gateway).
Icmp redirects should not be used to provide routing direction nowadays, even
for end hosts. Routers should not use them too (and this is explicitly restricted
in IPv6, see RFC 4861, clause 8.2).
Current commit changes rnh_machaddr function to 'stock' rn_match (and back) for every
AF_INET routing table in given VNET instance on drop_redirect sysctl change.
This change is part of bigger patch eliminating rte locking.
Sponsored by: Yandex LLC
MFC after: 2 weeks
Diffstat (limited to 'sys/netinet/ip_var.h')
-rw-r--r-- | sys/netinet/ip_var.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index 68f3cb9..a685ddd 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -188,6 +188,7 @@ VNET_DECLARE(struct socket *, ip_mrouter); /* multicast routing daemon */ extern int (*legal_vif_num)(int); extern u_long (*ip_mcast_src)(int); VNET_DECLARE(int, rsvp_on); +VNET_DECLARE(int, drop_redirect); extern struct pr_usrreqs rip_usrreqs; #define V_ipstat VNET(ipstat) @@ -200,6 +201,7 @@ extern struct pr_usrreqs rip_usrreqs; #define V_ip_rsvpd VNET(ip_rsvpd) #define V_ip_mrouter VNET(ip_mrouter) #define V_rsvp_on VNET(rsvp_on) +#define V_drop_redirect VNET(drop_redirect) void inp_freemoptions(struct ip_moptions *); int inp_getmoptions(struct inpcb *, struct sockopt *); |