Thread (18 messages) 18 messages, 5 authors, 2018-02-04

Re: sctp netns "unregister_netdevice: waiting for lo to become free. Usage count = 1"

From: Alexey Kodanev <hidden>
Date: 2018-02-02 12:18:12
Also in: linux-sctp

On 02.02.2018 11:27, Tommi Rantala wrote:
2018-02-02 1:57 GMT+02:00 Alexey Kodanev [off-list ref]:
quoted
For ipv6 part, shouldn't we release 'bdst' there if the previous address
match is better and we continue to the next iteration?
Good catch!
On the second thought, I think, we should also check 'bdst' ptr for
the error earlier, i.e. right after 'bdst = ip6_dst_lookup_flow(...)'.
I'll prepare the patch.

Thanks,
Alexey

Didn't see that one.

Tommi
quoted
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 5d4c15b..a044096 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -336,8 +336,11 @@ static void sctp_v6_get_dst(struct sctp_transport *t, union sctp_addr *saddr,
                }

                bmatchlen = sctp_v6_addr_match_len(daddr, &laddr->a);
-               if (matchlen > bmatchlen)
+               if (matchlen > bmatchlen) {
+                       if (!IS_ERR(bdst))
+                               dst_release(bdst);
                        continue;
+               }

                if (!IS_ERR_OR_NULL(dst))
                        dst_release(dst);
Thanks,
Alexey
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help