[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20211109114612.GC16363@breakpoint.cc>
Date: Tue, 9 Nov 2021 12:46:12 +0100
From: Florian Westphal <fw@...len.de>
To: Changliang Wu <changliang.wu@...rtx.com>
Cc: davem@...emloft.net, kuba@...nel.org, yoshfuji@...ux-ipv6.org,
dsahern@...nel.org, edumazet@...gle.com, idosch@....NVIDIA.COM,
amcohen@...dia.com, fw@...len.de, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] ipv4: add sysctl knob to control the discarding of skb
from local in ip_forward
Changliang Wu <changliang.wu@...rtx.com> wrote:
> This change is meant to add a control for forwarding skb from local.
> By default, ip forward will not receive the pakcet to/from the local.
> But in some special cases, for example:
> -
> | ovs-bridge gw-port | <----> kube-proxy(iptables) |
> -
> Ovs sends the packet to the gateway, which requires iptables for nat,
> such as kube-proxy (iptables), and then sends it back to the gateway
> through routing for further processing in ovs.
This a very terse description. How does packet end up in forward
after skb->sk assignment?
> diff --git a/net/ipv4/ip_forward.c b/net/ipv4/ip_forward.c
> index 00ec819..06b7e00 100644
> --- a/net/ipv4/ip_forward.c
> +++ b/net/ipv4/ip_forward.c
> @@ -95,9 +95,6 @@ int ip_forward(struct sk_buff *skb)
> if (skb->pkt_type != PACKET_HOST)
> goto drop;
>
> - if (unlikely(skb->sk))
> - goto drop;
> -
Please have a look at
2ab957492d13bb819400ac29ae55911d50a82a13
you need to explain why this is now ok.
Without explanation i have to assume stack will now crash again
when net->ipv4.sysctl_ip_fwd_accept_local=1 and TW socket is assigned.
Powered by blists - more mailing lists