Re: [PATCH net-next v4 2/4] net: ipv6: ioam6_iptunnel: mitigate 2-realloc issue
From: Justin Iurman
Date: Tue Nov 19 2024 - 07:59:56 EST
On 11/19/24 11:42, Paolo Abeni wrote>> - skb_dst_drop(skb);
- skb_dst_set(skb, dst);
+ skb_dst_drop(skb);
+ skb_dst_set(skb, dst);
Why the above 2 statements are not done only in case of ip address
match, as in the existing code?
I guess you meant "when they do *not* match", right?
+ if (!ipv6_addr_equal(&orig_daddr, &ipv6_hdr(skb)->daddr))
return dst_output(net, sk, skb);
- }
Good catch. Initially, the only reason was to be on the safe side. Will
change it to:
if (!ipv6_addr_equal(&orig_daddr, &ipv6_hdr(skb)->daddr)) {
skb_dst_drop(skb);
skb_dst_set(skb, dst);
return dst_output(net, sk, skb);
}
Thanks Paolo!
Cheers,
Justin