|
@@ -678,7 +678,6 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
|
|
|
|
|
EnterFunction(10);
|
|
EnterFunction(10);
|
|
|
|
|
|
|
|
- rcu_read_lock();
|
|
|
|
|
if (__ip_vs_get_out_rt(cp->ipvs, cp->af, skb, NULL, iph->daddr,
|
|
if (__ip_vs_get_out_rt(cp->ipvs, cp->af, skb, NULL, iph->daddr,
|
|
|
IP_VS_RT_MODE_NON_LOCAL, NULL, ipvsh) < 0)
|
|
IP_VS_RT_MODE_NON_LOCAL, NULL, ipvsh) < 0)
|
|
|
goto tx_error;
|
|
goto tx_error;
|
|
@@ -689,14 +688,12 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
skb->ignore_df = 1;
|
|
skb->ignore_df = 1;
|
|
|
|
|
|
|
|
ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0);
|
|
ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
|
|
|
|
|
tx_error:
|
|
tx_error:
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
}
|
|
}
|
|
@@ -710,7 +707,6 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
|
|
|
|
|
EnterFunction(10);
|
|
EnterFunction(10);
|
|
|
|
|
|
|
|
- rcu_read_lock();
|
|
|
|
|
if (__ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, NULL,
|
|
if (__ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, NULL,
|
|
|
&iph->daddr, NULL,
|
|
&iph->daddr, NULL,
|
|
|
ipvsh, 0, IP_VS_RT_MODE_NON_LOCAL) < 0)
|
|
ipvsh, 0, IP_VS_RT_MODE_NON_LOCAL) < 0)
|
|
@@ -720,14 +716,12 @@ ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
skb->ignore_df = 1;
|
|
skb->ignore_df = 1;
|
|
|
|
|
|
|
|
ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0);
|
|
ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
|
|
|
|
|
tx_error:
|
|
tx_error:
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
}
|
|
}
|
|
@@ -746,7 +740,6 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
|
|
|
|
|
EnterFunction(10);
|
|
EnterFunction(10);
|
|
|
|
|
|
|
|
- rcu_read_lock();
|
|
|
|
|
/* check if it is a connection of no-client-port */
|
|
/* check if it is a connection of no-client-port */
|
|
|
if (unlikely(cp->flags & IP_VS_CONN_F_NO_CPORT)) {
|
|
if (unlikely(cp->flags & IP_VS_CONN_F_NO_CPORT)) {
|
|
|
__be16 _pt, *p;
|
|
__be16 _pt, *p;
|
|
@@ -815,14 +808,12 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
skb->ignore_df = 1;
|
|
skb->ignore_df = 1;
|
|
|
|
|
|
|
|
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local);
|
|
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return rc;
|
|
return rc;
|
|
|
|
|
|
|
|
tx_error:
|
|
tx_error:
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
}
|
|
}
|
|
@@ -837,7 +828,6 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
|
|
|
|
|
EnterFunction(10);
|
|
EnterFunction(10);
|
|
|
|
|
|
|
|
- rcu_read_lock();
|
|
|
|
|
/* check if it is a connection of no-client-port */
|
|
/* check if it is a connection of no-client-port */
|
|
|
if (unlikely(cp->flags & IP_VS_CONN_F_NO_CPORT && !ipvsh->fragoffs)) {
|
|
if (unlikely(cp->flags & IP_VS_CONN_F_NO_CPORT && !ipvsh->fragoffs)) {
|
|
|
__be16 _pt, *p;
|
|
__be16 _pt, *p;
|
|
@@ -906,7 +896,6 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
skb->ignore_df = 1;
|
|
skb->ignore_df = 1;
|
|
|
|
|
|
|
|
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local);
|
|
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return rc;
|
|
return rc;
|
|
@@ -914,7 +903,6 @@ ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
tx_error:
|
|
tx_error:
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
}
|
|
}
|
|
|
#endif
|
|
#endif
|
|
@@ -1035,7 +1023,6 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
|
|
|
|
|
EnterFunction(10);
|
|
EnterFunction(10);
|
|
|
|
|
|
|
|
- rcu_read_lock();
|
|
|
|
|
local = __ip_vs_get_out_rt(ipvs, cp->af, skb, cp->dest, cp->daddr.ip,
|
|
local = __ip_vs_get_out_rt(ipvs, cp->af, skb, cp->dest, cp->daddr.ip,
|
|
|
IP_VS_RT_MODE_LOCAL |
|
|
IP_VS_RT_MODE_LOCAL |
|
|
|
IP_VS_RT_MODE_NON_LOCAL |
|
|
IP_VS_RT_MODE_NON_LOCAL |
|
|
@@ -1043,10 +1030,8 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
IP_VS_RT_MODE_TUNNEL, &saddr, ipvsh);
|
|
IP_VS_RT_MODE_TUNNEL, &saddr, ipvsh);
|
|
|
if (local < 0)
|
|
if (local < 0)
|
|
|
goto tx_error;
|
|
goto tx_error;
|
|
|
- if (local) {
|
|
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
+ if (local)
|
|
|
return ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 1);
|
|
return ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 1);
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
rt = skb_rtable(skb);
|
|
rt = skb_rtable(skb);
|
|
|
tdev = rt->dst.dev;
|
|
tdev = rt->dst.dev;
|
|
@@ -1095,7 +1080,6 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
ip_local_out(net, skb->sk, skb);
|
|
ip_local_out(net, skb->sk, skb);
|
|
|
else if (ret == NF_DROP)
|
|
else if (ret == NF_DROP)
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
|
|
|
|
@@ -1104,7 +1088,6 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
tx_error:
|
|
tx_error:
|
|
|
if (!IS_ERR(skb))
|
|
if (!IS_ERR(skb))
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
}
|
|
}
|
|
@@ -1127,7 +1110,6 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
|
|
|
|
|
EnterFunction(10);
|
|
EnterFunction(10);
|
|
|
|
|
|
|
|
- rcu_read_lock();
|
|
|
|
|
local = __ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, cp->dest,
|
|
local = __ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, cp->dest,
|
|
|
&cp->daddr.in6,
|
|
&cp->daddr.in6,
|
|
|
&saddr, ipvsh, 1,
|
|
&saddr, ipvsh, 1,
|
|
@@ -1136,10 +1118,8 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
IP_VS_RT_MODE_TUNNEL);
|
|
IP_VS_RT_MODE_TUNNEL);
|
|
|
if (local < 0)
|
|
if (local < 0)
|
|
|
goto tx_error;
|
|
goto tx_error;
|
|
|
- if (local) {
|
|
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
+ if (local)
|
|
|
return ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 1);
|
|
return ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 1);
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
rt = (struct rt6_info *) skb_dst(skb);
|
|
rt = (struct rt6_info *) skb_dst(skb);
|
|
|
tdev = rt->dst.dev;
|
|
tdev = rt->dst.dev;
|
|
@@ -1185,7 +1165,6 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
ip6_local_out(cp->ipvs->net, skb->sk, skb);
|
|
ip6_local_out(cp->ipvs->net, skb->sk, skb);
|
|
|
else if (ret == NF_DROP)
|
|
else if (ret == NF_DROP)
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
|
|
|
|
@@ -1194,7 +1173,6 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
tx_error:
|
|
tx_error:
|
|
|
if (!IS_ERR(skb))
|
|
if (!IS_ERR(skb))
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
}
|
|
}
|
|
@@ -1213,17 +1191,14 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
|
|
|
|
|
EnterFunction(10);
|
|
EnterFunction(10);
|
|
|
|
|
|
|
|
- rcu_read_lock();
|
|
|
|
|
local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip,
|
|
local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip,
|
|
|
IP_VS_RT_MODE_LOCAL |
|
|
IP_VS_RT_MODE_LOCAL |
|
|
|
IP_VS_RT_MODE_NON_LOCAL |
|
|
IP_VS_RT_MODE_NON_LOCAL |
|
|
|
IP_VS_RT_MODE_KNOWN_NH, NULL, ipvsh);
|
|
IP_VS_RT_MODE_KNOWN_NH, NULL, ipvsh);
|
|
|
if (local < 0)
|
|
if (local < 0)
|
|
|
goto tx_error;
|
|
goto tx_error;
|
|
|
- if (local) {
|
|
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
+ if (local)
|
|
|
return ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 1);
|
|
return ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 1);
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
ip_send_check(ip_hdr(skb));
|
|
ip_send_check(ip_hdr(skb));
|
|
|
|
|
|
|
@@ -1231,14 +1206,12 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
skb->ignore_df = 1;
|
|
skb->ignore_df = 1;
|
|
|
|
|
|
|
|
ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0);
|
|
ip_vs_send_or_cont(NFPROTO_IPV4, skb, cp, 0);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
|
|
|
|
|
tx_error:
|
|
tx_error:
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
}
|
|
}
|
|
@@ -1252,7 +1225,6 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
|
|
|
|
|
EnterFunction(10);
|
|
EnterFunction(10);
|
|
|
|
|
|
|
|
- rcu_read_lock();
|
|
|
|
|
local = __ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, cp->dest,
|
|
local = __ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, cp->dest,
|
|
|
&cp->daddr.in6,
|
|
&cp->daddr.in6,
|
|
|
NULL, ipvsh, 0,
|
|
NULL, ipvsh, 0,
|
|
@@ -1261,23 +1233,19 @@ ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
IP_VS_RT_MODE_KNOWN_NH);
|
|
IP_VS_RT_MODE_KNOWN_NH);
|
|
|
if (local < 0)
|
|
if (local < 0)
|
|
|
goto tx_error;
|
|
goto tx_error;
|
|
|
- if (local) {
|
|
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
+ if (local)
|
|
|
return ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 1);
|
|
return ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 1);
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
/* Another hack: avoid icmp_send in ip_fragment */
|
|
/* Another hack: avoid icmp_send in ip_fragment */
|
|
|
skb->ignore_df = 1;
|
|
skb->ignore_df = 1;
|
|
|
|
|
|
|
|
ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0);
|
|
ip_vs_send_or_cont(NFPROTO_IPV6, skb, cp, 0);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
|
|
|
|
|
tx_error:
|
|
tx_error:
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
|
return NF_STOLEN;
|
|
return NF_STOLEN;
|
|
|
}
|
|
}
|
|
@@ -1322,7 +1290,6 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
rt_mode = (hooknum != NF_INET_FORWARD) ?
|
|
rt_mode = (hooknum != NF_INET_FORWARD) ?
|
|
|
IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
|
|
IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
|
|
|
IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
|
|
IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
|
|
|
- rcu_read_lock();
|
|
|
|
|
local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip, rt_mode,
|
|
local = __ip_vs_get_out_rt(cp->ipvs, cp->af, skb, cp->dest, cp->daddr.ip, rt_mode,
|
|
|
NULL, iph);
|
|
NULL, iph);
|
|
|
if (local < 0)
|
|
if (local < 0)
|
|
@@ -1368,12 +1335,10 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
skb->ignore_df = 1;
|
|
skb->ignore_df = 1;
|
|
|
|
|
|
|
|
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local);
|
|
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV4, skb, cp, local);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
|
|
tx_error:
|
|
tx_error:
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
rc = NF_STOLEN;
|
|
rc = NF_STOLEN;
|
|
|
out:
|
|
out:
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|
|
@@ -1414,7 +1379,6 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
rt_mode = (hooknum != NF_INET_FORWARD) ?
|
|
rt_mode = (hooknum != NF_INET_FORWARD) ?
|
|
|
IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
|
|
IP_VS_RT_MODE_LOCAL | IP_VS_RT_MODE_NON_LOCAL |
|
|
|
IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
|
|
IP_VS_RT_MODE_RDR : IP_VS_RT_MODE_NON_LOCAL;
|
|
|
- rcu_read_lock();
|
|
|
|
|
local = __ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, cp->dest,
|
|
local = __ip_vs_get_out_rt_v6(cp->ipvs, cp->af, skb, cp->dest,
|
|
|
&cp->daddr.in6, NULL, ipvsh, 0, rt_mode);
|
|
&cp->daddr.in6, NULL, ipvsh, 0, rt_mode);
|
|
|
if (local < 0)
|
|
if (local < 0)
|
|
@@ -1460,12 +1424,10 @@ ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
|
|
|
skb->ignore_df = 1;
|
|
skb->ignore_df = 1;
|
|
|
|
|
|
|
|
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local);
|
|
rc = ip_vs_nat_send_or_cont(NFPROTO_IPV6, skb, cp, local);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
goto out;
|
|
goto out;
|
|
|
|
|
|
|
|
tx_error:
|
|
tx_error:
|
|
|
kfree_skb(skb);
|
|
kfree_skb(skb);
|
|
|
- rcu_read_unlock();
|
|
|
|
|
rc = NF_STOLEN;
|
|
rc = NF_STOLEN;
|
|
|
out:
|
|
out:
|
|
|
LeaveFunction(10);
|
|
LeaveFunction(10);
|