|
@@ -1394,10 +1394,8 @@ ip_vs_in_icmp(struct sk_buff *skb, int *related, unsigned int hooknum)
|
|
|
skb_reset_network_header(skb);
|
|
|
IP_VS_DBG(12, "ICMP for IPIP %pI4->%pI4: mtu=%u\n",
|
|
|
&ip_hdr(skb)->saddr, &ip_hdr(skb)->daddr, mtu);
|
|
|
- rcu_read_lock();
|
|
|
ipv4_update_pmtu(skb, dev_net(skb->dev),
|
|
|
mtu, 0, 0, 0, 0);
|
|
|
- rcu_read_unlock();
|
|
|
/* Client uses PMTUD? */
|
|
|
if (!(cih->frag_off & htons(IP_DF)))
|
|
|
goto ignore_ipip;
|
|
@@ -1577,7 +1575,8 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
|
|
|
}
|
|
|
/* ipvs enabled in this netns ? */
|
|
|
net = skb_net(skb);
|
|
|
- if (!net_ipvs(net)->enable)
|
|
|
+ ipvs = net_ipvs(net);
|
|
|
+ if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
|
|
|
return NF_ACCEPT;
|
|
|
|
|
|
ip_vs_fill_iph_skb(af, skb, &iph);
|
|
@@ -1654,7 +1653,6 @@ ip_vs_in(unsigned int hooknum, struct sk_buff *skb, int af)
|
|
|
}
|
|
|
|
|
|
IP_VS_DBG_PKT(11, af, pp, skb, 0, "Incoming packet");
|
|
|
- ipvs = net_ipvs(net);
|
|
|
/* Check the server status */
|
|
|
if (cp->dest && !(cp->dest->flags & IP_VS_DEST_F_AVAILABLE)) {
|
|
|
/* the destination server is not available */
|
|
@@ -1815,13 +1813,15 @@ ip_vs_forward_icmp(unsigned int hooknum, struct sk_buff *skb,
|
|
|
{
|
|
|
int r;
|
|
|
struct net *net;
|
|
|
+ struct netns_ipvs *ipvs;
|
|
|
|
|
|
if (ip_hdr(skb)->protocol != IPPROTO_ICMP)
|
|
|
return NF_ACCEPT;
|
|
|
|
|
|
/* ipvs enabled in this netns ? */
|
|
|
net = skb_net(skb);
|
|
|
- if (!net_ipvs(net)->enable)
|
|
|
+ ipvs = net_ipvs(net);
|
|
|
+ if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
|
|
|
return NF_ACCEPT;
|
|
|
|
|
|
return ip_vs_in_icmp(skb, &r, hooknum);
|
|
@@ -1835,6 +1835,7 @@ ip_vs_forward_icmp_v6(unsigned int hooknum, struct sk_buff *skb,
|
|
|
{
|
|
|
int r;
|
|
|
struct net *net;
|
|
|
+ struct netns_ipvs *ipvs;
|
|
|
struct ip_vs_iphdr iphdr;
|
|
|
|
|
|
ip_vs_fill_iph_skb(AF_INET6, skb, &iphdr);
|
|
@@ -1843,7 +1844,8 @@ ip_vs_forward_icmp_v6(unsigned int hooknum, struct sk_buff *skb,
|
|
|
|
|
|
/* ipvs enabled in this netns ? */
|
|
|
net = skb_net(skb);
|
|
|
- if (!net_ipvs(net)->enable)
|
|
|
+ ipvs = net_ipvs(net);
|
|
|
+ if (unlikely(sysctl_backup_only(ipvs) || !ipvs->enable))
|
|
|
return NF_ACCEPT;
|
|
|
|
|
|
return ip_vs_in_icmp_v6(skb, &r, hooknum, &iphdr);
|