On 8/16/19 5:24 AM, Hangbin Liu wrote:
> Hi Eric,
>
> Thanks for the review.
> On Thu, Aug 15, 2019 at 11:16:58AM +0200, Eric Dumazet wrote:
>>> diff --git a/net/ipv4/ip_tunnel.c b/net/ipv4/ip_tunnel.c
>>> index 38c02bb62e2c..c6713c7287df 100644
>>> --- a/net/ipv4/ip_tunnel.c
>>> +++ b/net/ipv4/ip_tunnel.c
>>> @@ -597,6 +597,9 @@ void ip_md_tunnel_xmit(struct sk_buff *skb, struct
>>> net_device *dev,
>>> goto tx_error;
>>> }
>>>
>>> + if (skb_dst(skb) && !skb_dst(skb)->dev)
>>> + skb_dst(skb)->dev = rt->dst.dev;
>>> +
>>
>>
>> IMO this looks wrong.
>> This dst seems shared.
>
> If the dst is shared, it may cause some problem. Could you point me where the
> dst may be shared possibly?
>
dst are inherently shared.
This is why we have a refcount on them.
Only when the dst has been allocated by the current thread we can make changes
on them.