All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net v2] ipv6: release dst on error in ip6_dst_lookup_tail
@ 2017-02-19  0:00 Willem de Bruijn
  2017-02-19  0:26 ` Eric Dumazet
  2017-02-19  3:55 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Willem de Bruijn @ 2017-02-19  0:00 UTC (permalink / raw)
  To: netdev; +Cc: davem, eric.dumazet, jtleight, Willem de Bruijn

From: Willem de Bruijn <willemb@google.com>

If ip6_dst_lookup_tail has acquired a dst and fails the IPv4-mapped
check, release the dst before returning an error.

Fixes: ec5e3b0a1d41 ("ipv6: Inhibit IPv4-mapped src address on the wire.")
Signed-off-by: Willem de Bruijn <willemb@google.com>
---
 net/ipv6/ip6_output.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index e164684456df..7cebee58e55b 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -1022,8 +1022,10 @@ static int ip6_dst_lookup_tail(struct net *net, const struct sock *sk,
 	}
 #endif
 	if (ipv6_addr_v4mapped(&fl6->saddr) &&
-	    !(ipv6_addr_v4mapped(&fl6->daddr) || ipv6_addr_any(&fl6->daddr)))
-		return -EAFNOSUPPORT;
+	    !(ipv6_addr_v4mapped(&fl6->daddr) || ipv6_addr_any(&fl6->daddr))) {
+		err = -EAFNOSUPPORT;
+		goto out_err_release;
+	}
 
 	return 0;
 
-- 
2.11.0.483.g087da7b7c-goog

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] ipv6: release dst on error in ip6_dst_lookup_tail
  2017-02-19  0:00 [PATCH net v2] ipv6: release dst on error in ip6_dst_lookup_tail Willem de Bruijn
@ 2017-02-19  0:26 ` Eric Dumazet
  2017-02-19  3:55 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2017-02-19  0:26 UTC (permalink / raw)
  To: Willem de Bruijn; +Cc: netdev, davem, jtleight, Willem de Bruijn

On Sat, 2017-02-18 at 19:00 -0500, Willem de Bruijn wrote:
> From: Willem de Bruijn <willemb@google.com>
> 
> If ip6_dst_lookup_tail has acquired a dst and fails the IPv4-mapped
> check, release the dst before returning an error.
> 
> Fixes: ec5e3b0a1d41 ("ipv6: Inhibit IPv4-mapped src address on the wire.")
> Signed-off-by: Willem de Bruijn <willemb@google.com>
> ---
Acked-by: Eric Dumazet <edumazet@google.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2] ipv6: release dst on error in ip6_dst_lookup_tail
  2017-02-19  0:00 [PATCH net v2] ipv6: release dst on error in ip6_dst_lookup_tail Willem de Bruijn
  2017-02-19  0:26 ` Eric Dumazet
@ 2017-02-19  3:55 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2017-02-19  3:55 UTC (permalink / raw)
  To: willemdebruijn.kernel; +Cc: netdev, eric.dumazet, jtleight, willemb

From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date: Sat, 18 Feb 2017 19:00:45 -0500

> From: Willem de Bruijn <willemb@google.com>
> 
> If ip6_dst_lookup_tail has acquired a dst and fails the IPv4-mapped
> check, release the dst before returning an error.
> 
> Fixes: ec5e3b0a1d41 ("ipv6: Inhibit IPv4-mapped src address on the wire.")
> Signed-off-by: Willem de Bruijn <willemb@google.com>

Applied, thanks Willem.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-19  3:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-19  0:00 [PATCH net v2] ipv6: release dst on error in ip6_dst_lookup_tail Willem de Bruijn
2017-02-19  0:26 ` Eric Dumazet
2017-02-19  3:55 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.