ipv4: use daddr to get inet_peer
Subsystems (3)
PATCH 1/1 ipv4: use daddr to get inet_peer
since commit 1d861aa4("inet: Minimize use of cached route inetpeer"), ip_error() uses saddr to get inet_peer, so ip_error() and icmpv4_xrlim_allow() use the same inet_peer to limit icmp error message twice.
In ip_error(), peer->rate_tokens is set to ip_rt_error_burst, but in inet_peer_xrlim_allow() peer->rate_tokens is set to XRLIM_BURST_FACTOR. XRLIM_BURST_FACTOR is defined to 6, so user seting ip_rt_error_burst makes no sense.
In my opinion, the ip_rt_error_burst is used to limit icmp error messages for daddr instead of saddr.
--- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/route.c +1 -1
@@ -933,7 +933,7 @@ static int ip_error(struct sk_buff *skb)break ; } - peer =inet_getpeer_v4 (net->ipv4.peers,ip_hdr (skb)->saddr,1 ); + peer =inet_getpeer_v4 (net->ipv4.peers,ip_hdr (skb)->daddr,1 ); send = true;if (peer) {
Signature · 1 line
1.8.3.1
Quoted 5 lines · Duan Jiong
since commit 1d861aa4("inet: Minimize use of cached route inetpeer"),
ip_error()uses saddr to getinet_peer, soip_error()andicmpv4_xrlim_allow()use the sameinet_peerto limit icmp error message twice.
Quoted 7 lines
In
ip_error(),peer->rate_tokensis set toip_rt_error_burst, but ininet_peer_xrlim_allow()peer->rate_tokensis set toXRLIM_BURST_FACTOR.XRLIM_BURST_FACTORis defined to 6, so user setingip_rt_error_burstmakes no sense.In my opinion, the
ip_rt_error_burstis used to limit icmp error messages for daddr instead of saddr.
Hmmm...
ip_error is a dst_input function, as such it gets called with the incoming packet. saddr is the address we send the reply back (see icmp_send->icmp_route_lookup).
Sorry, I don't think the patch is correct.
Bye,
Hannes
Quoted 11 lines · Hannes Frederic Sowa
Quoted 10 lines · Duan Jiong
since commit 1d861aa4("inet: Minimize use of cached route inetpeer"),
ip_error()uses saddr to getinet_peer, soip_error()andicmpv4_xrlim_allow()use the sameinet_peerto limit icmp error message twice.In
ip_error(),peer->rate_tokensis set toip_rt_error_burst, but ininet_peer_xrlim_allow()peer->rate_tokensis set toXRLIM_BURST_FACTOR.XRLIM_BURST_FACTORis defined to 6, so user setingip_rt_error_burstmakes no sense.
Quoted 9 lines
Quoted 2 lines
In my opinion, the
ip_rt_error_burstis used to limit icmp error messages for daddr instead of saddr.Hmmm...
ip_erroris adst_inputfunction, as such it gets called with the incoming packet. saddr is the address we send the reply back (seeicmp_send->icmp_route_lookup).
But if we still use saddr to get inet_peer, seting ip_rt_error_burst will make no sense, because it will be overwrited by XRLIM_BURST_FACTOR.
Thanks,
Duan
Quoted 11 lines
Sorry, I don't think the patch is correct.
Bye,
Hannes
--
To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 17 lines · Duan Jiong
Quoted 16 lines · Hannes Frederic Sowa
Quoted 5 lines · Duan Jiong
since commit 1d861aa4("inet: Minimize use of cached route inetpeer"),
ip_error()uses saddr to getinet_peer, soip_error()andicmpv4_xrlim_allow()use the sameinet_peerto limit icmp error message twice.Quoted 7 lines
In
ip_error(),peer->rate_tokensis set toip_rt_error_burst, but ininet_peer_xrlim_allow()peer->rate_tokensis set toXRLIM_BURST_FACTOR.XRLIM_BURST_FACTORis defined to 6, so user setingip_rt_error_burstmakes no sense.In my opinion, the
ip_rt_error_burstis used to limit icmp error messages for daddr instead of saddr.Hmmm...
Quoted 7 lines
Quoted 4 lines
ip_erroris adst_inputfunction, as such it gets called with the incoming packet. saddr is the address we send the reply back (seeicmp_send->icmp_route_lookup).But if we still use saddr to get
inet_peer, setingip_rt_error_burstwill make no sense, because it will be overwrited byXRLIM_BURST_FACTOR.
Sorry, I cannot follow you.
On output we refetch the inetpeer with the destination address. I don't see how the patch helps.
Greetings,
Hannes