Skip to contentSkip to conversation

netfilter: nft_reject_bridge: remove unnecessary ttl set

PATCH In review Taehee Yoo 1 participant 2 messages Jun 11, 2018

Subsystems (4)
lore
Share & tools
lore

Taehee Yoo

author
#0 lore raw

PATCH 1/1 netfilter: nft_reject_bridge: remove unnecessary ttl set

In the nft_reject_br_send_v4_tcp_reset(), a ttl is set by the nf_reject_ip_tcphdr_put(). so, below code is unnecessary.

---
 net/bridge/netfilter/nft_reject_bridge.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/bridge/netfilter/nft_reject_bridge.c +1 -2
index eaf05de..e0b082c 100644
@@ -89,8 +89,7 @@ static void nft_reject_br_send_v4_tcp_reset(struct net *net,
 	niph = nf_reject_iphdr_put(nskb, oldskb, IPPROTO_TCP,
 				   net->ipv4.sysctl_ip_default_ttl);
 	nf_reject_ip_tcphdr_put(nskb, oldskb, oth);
-	niph->ttl	= net->ipv4.sysctl_ip_default_ttl;
-	niph->tot_len	= htons(nskb->len);
+	niph->tot_len = htons(nskb->len);
 	ip_send_check(niph);
 
 	nft_reject_br_push_etherhdr(oldskb, nskb);
Signature · 1 line
2.9.3
author
#1 lore raw

2018-06-12 1:35 GMT+09:00 Taehee Yoo <[email protected]>:

Quoted 23 lines

In the nft_reject_br_send_v4_tcp_reset(), a ttl is set by the nf_reject_ip_tcphdr_put(). so, below code is unnecessary.

---
 net/bridge/netfilter/nft_reject_bridge.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
net/bridge/netfilter/nft_reject_bridge.c +1 -3
index eaf05de..e0b082c 100644
@@ -89,8 +89,7 @@ static void nft_reject_br_send_v4_tcp_reset(struct net *net,
        niph = nf_reject_iphdr_put(nskb, oldskb, IPPROTO_TCP,
                                   net->ipv4.sysctl_ip_default_ttl);
        nf_reject_ip_tcphdr_put(nskb, oldskb, oth);
-       niph->ttl       = net->ipv4.sysctl_ip_default_ttl;
-       niph->tot_len   = htons(nskb->len);
+       niph->tot_len = htons(nskb->len);
        ip_send_check(niph);
 
        nft_reject_br_push_etherhdr(oldskb, nskb);
--
Quoted 2 lines

2.9.3

I'm so sorry, I sent this to you by mistake.
Please ignore this.

Thanks