[nf-next] netfilter: nft_reject_bridge: remove unnecessary ttl set

Message ID 20180611165447.12064-1-ap420073@gmail.com
State Accepted
Delegated to: Pablo Neira
Headers show
Series
  • [nf-next] netfilter: nft_reject_bridge: remove unnecessary ttl set
Related show

Commit Message

Taehee Yoo June 11, 2018, 4:54 p.m.
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.

Signed-off-by: Taehee Yoo <ap420073@gmail.com>
---
 net/bridge/netfilter/nft_reject_bridge.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Pablo Neira Ayuso June 27, 2018, 2:48 p.m. | #1
On Tue, Jun 12, 2018 at 01:54:47AM +0900, Taehee Yoo wrote:
> 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.

Applied, thanks.

BTW, it's nf_reject_iphdr_put() the one that sets ttl, not
nf_reject_ip_tcphdr_put(). I have mangled this before applying, no
problem.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Taehee Yoo June 27, 2018, 3:13 p.m. | #2
2018-06-27 23:48 GMT+09:00 Pablo Neira Ayuso <pablo@netfilter.org>:
> On Tue, Jun 12, 2018 at 01:54:47AM +0900, Taehee Yoo wrote:
>> 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.
>
> Applied, thanks.
>
> BTW, it's nf_reject_iphdr_put() the one that sets ttl, not
> nf_reject_ip_tcphdr_put(). I have mangled this before applying, no
> problem.

Thank you for reviewing!
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/net/bridge/netfilter/nft_reject_bridge.c b/net/bridge/netfilter/nft_reject_bridge.c
index eaf05de..e0b082c 100644
--- a/net/bridge/netfilter/nft_reject_bridge.c
+++ b/net/bridge/netfilter/nft_reject_bridge.c
@@ -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);