Skip to contentSkip to conversation

ipvs: remove unnecessary assignment in __ip_vs_get_out_rt

PATCH In review Alex Gartrell 3 participants 3 messages Oct 6, 2014 – Oct 17, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipvs: remove unnecessary assignment in __ip_vs_get_out_rt

It is a precondition of the function that daddr be equal to dest->addr.ip if dest is non-NULL, so this additional assignment is just confusing for stupid engineers like me.

---
 net/netfilter/ipvs/ip_vs_xmit.c | 1 -
 1 file changed, 1 deletion(-)
net/netfilter/ipvs/ip_vs_xmit.c +0 -1
index 91f17c1..5efa597 100644
@@ -293,7 +293,6 @@ __ip_vs_get_out_rt(int skb_af, struct sk_buff *skb, struct ip_vs_dest *dest,
 				  &dest->addr.ip, &dest_dst->dst_saddr.ip,
 				  atomic_read(&rt->dst.__refcnt));
 		}
-		daddr = dest->addr.ip;
 		if (ret_saddr)
 			*ret_saddr = dest_dst->dst_saddr.ip;
 	} else {
Signature · 1 line
Alex Gartrell <[email protected]>
maintainer Acked-by on v1 1/1
#1 lore raw

Hello,

Quoted 5 lines · Alex Gartrell

It is a precondition of the function that daddr be equal to dest->addr.ip if dest is non-NULL, so this additional assignment is just confusing for stupid engineers like me.

Looks like this line appeared unexpectedly
in commit "ipvs: Eliminate rt->rt_dst usage in __ip_vs_get_out_rt()."

Quoted 18 lines
---
 net/netfilter/ipvs/ip_vs_xmit.c | 1 -
 1 file changed, 1 deletion(-)
net/netfilter/ipvs/ip_vs_xmit.c +0 -1
index 91f17c1..5efa597 100644
@@ -293,7 +293,6 @@ __ip_vs_get_out_rt(int skb_af, struct sk_buff *skb, struct ip_vs_dest *dest,
 				  &dest->addr.ip, &dest_dst->dst_saddr.ip,
 				  atomic_read(&rt->dst.__refcnt));
 		}
-		daddr = dest->addr.ip;
 		if (ret_saddr)
 			*ret_saddr = dest_dst->dst_saddr.ip;
 	} else {
Signature · 1 line
Alex Gartrell <[email protected]>

Regards

--
Julian Anastasov <[email protected]>

maintainer
#2 lore raw
Quoted 9 lines · Julian Anastasov

Hello,

Quoted 4 lines · Alex Gartrell

It is a precondition of the function that daddr be equal to dest->addr.ip if dest is non-NULL, so this additional assignment is just confusing for stupid engineers like me.

Quoted 6 lines
Quoted 1 line

Looks like this line appeared unexpectedly
in commit "ipvs: Eliminate rt->rt_dst usage in __ip_vs_get_out_rt()."

Thanks, I have applied this to ipvs-next and will see about getting it included in v3.18.

Quoted 24 lines
Quoted 18 lines
---
 net/netfilter/ipvs/ip_vs_xmit.c | 1 -
 1 file changed, 1 deletion(-)
net/netfilter/ipvs/ip_vs_xmit.c +0 -1
index 91f17c1..5efa597 100644
@@ -293,7 +293,6 @@ __ip_vs_get_out_rt(int skb_af, struct sk_buff *skb, struct ip_vs_dest *dest,
 				  &dest->addr.ip, &dest_dst->dst_saddr.ip,
 				  atomic_read(&rt->dst.__refcnt));
 		}
-		daddr = dest->addr.ip;
 		if (ret_saddr)
 			*ret_saddr = dest_dst->dst_saddr.ip;
 	} else {
Signature · 1 line
Alex Gartrell <[email protected]>

Regards

--
Julian Anastasov <[email protected]>