|
@@ -1577,7 +1577,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 +1655,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 +1815,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 +1837,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 +1846,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);
|