public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH] conf: Fix erroneous check of ip6->gw
@ 2023-06-02  5:02 David Gibson
  2023-06-03  6:46 ` Stefano Brivio
  0 siblings, 1 reply; 2+ messages in thread
From: David Gibson @ 2023-06-02  5:02 UTC (permalink / raw)
  To: passt-dev, Stefano Brivio; +Cc: David Gibson

a7359f094898 ("conf: Don't exit if sourced default route has no gateway")
was supposed to allow passt/pasta to run even if given a template interface
which has no default gateway.  However a mistake in the patch means it
still requires the gateway, but doesn't require a global address for the
guest which we really do need.

This is one part (but not the only part) of the problem seen in
https://bugs.passt.top/show_bug.cgi?id=50.

Fixes: a7359f094898

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
 conf.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/conf.c b/conf.c
index d8414fe7..ffff235b 100644
--- a/conf.c
+++ b/conf.c
@@ -708,7 +708,7 @@ static unsigned int conf_ip6(unsigned int ifi,
 	if (MAC_IS_ZERO(mac))
 		nl_link(0, ifi, mac, 0, 0);
 
-	if (IN6_IS_ADDR_UNSPECIFIED(&ip6->gw) ||
+	if (IN6_IS_ADDR_UNSPECIFIED(&ip6->addr) ||
 	    IN6_IS_ADDR_UNSPECIFIED(&ip6->addr_ll) ||
 	    MAC_IS_ZERO(mac))
 		return 0;
-- 
@@ -708,7 +708,7 @@ static unsigned int conf_ip6(unsigned int ifi,
 	if (MAC_IS_ZERO(mac))
 		nl_link(0, ifi, mac, 0, 0);
 
-	if (IN6_IS_ADDR_UNSPECIFIED(&ip6->gw) ||
+	if (IN6_IS_ADDR_UNSPECIFIED(&ip6->addr) ||
 	    IN6_IS_ADDR_UNSPECIFIED(&ip6->addr_ll) ||
 	    MAC_IS_ZERO(mac))
 		return 0;
-- 
2.40.1


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

* Re: [PATCH] conf: Fix erroneous check of ip6->gw
  2023-06-02  5:02 [PATCH] conf: Fix erroneous check of ip6->gw David Gibson
@ 2023-06-03  6:46 ` Stefano Brivio
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Brivio @ 2023-06-03  6:46 UTC (permalink / raw)
  To: David Gibson; +Cc: passt-dev, Justin Jereza

On Fri,  2 Jun 2023 15:02:02 +1000
David Gibson <david@gibson.dropbear.id.au> wrote:

> a7359f094898 ("conf: Don't exit if sourced default route has no gateway")
> was supposed to allow passt/pasta to run even if given a template interface
> which has no default gateway.  However a mistake in the patch means it
> still requires the gateway, but doesn't require a global address for the
> guest which we really do need.
> 
> This is one part (but not the only part) of the problem seen in
> https://bugs.passt.top/show_bug.cgi?id=50.
>
> Fixes: a7359f094898

Thanks! Applied with:

Reported-by: Justin Jereza <justinjereza@gmail.com>
Fixes: a7359f094898 ("conf: Don't exit if sourced default route has no gateway")
Link: https://bugs.passt.top/show_bug.cgi?id=50
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>

If it helps (not that you need to care, really):
  git show -s --abbrev=12 --pretty=format:"Fixes: %h (\"%s\")" "${sha}"

or... scripts:
  https://lore.kernel.org/all/20190220205910.7bd7fd40@redhat.com/
  https://lore.kernel.org/all/20190220213729.49deb54f@redhat.com/

> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
>
> ---
>  conf.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/conf.c b/conf.c
> index d8414fe7..ffff235b 100644
> --- a/conf.c
> +++ b/conf.c
> @@ -708,7 +708,7 @@ static unsigned int conf_ip6(unsigned int ifi,
>  	if (MAC_IS_ZERO(mac))
>  		nl_link(0, ifi, mac, 0, 0);
>  
> -	if (IN6_IS_ADDR_UNSPECIFIED(&ip6->gw) ||
> +	if (IN6_IS_ADDR_UNSPECIFIED(&ip6->addr) ||
>  	    IN6_IS_ADDR_UNSPECIFIED(&ip6->addr_ll) ||
>  	    MAC_IS_ZERO(mac))
>  		return 0;

-- 
Stefano


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

end of thread, other threads:[~2023-06-03  6:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-02  5:02 [PATCH] conf: Fix erroneous check of ip6->gw David Gibson
2023-06-03  6:46 ` Stefano Brivio

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).