From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from imap.gmail.com [173.194.76.109] by localhost with POP3 (fetchmail-6.3.26) for (single-drop); Thu, 23 May 2024 03:48:55 +0200 (CEST) Received: by 2002:a05:6a11:2489:b0:55f:c3c0:ed08 with SMTP id sg9csp1026651pxb; Wed, 22 May 2024 18:48:35 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWnkfnjQ8Qlc//HtQNP6gd3A7zaVROzesPfHKURgaFlmkJf0doyVNIf2Nh/islwHpwyTJ6elQ7MSKXGuCU6ZnVQw5ngPJS0jQM= X-Google-Smtp-Source: AGHT+IE43RloucxY/rILHuLErspiCrM1+INYThGJLwtM/kXg58YJmPYLW3JHvB8mAqcEYfzacrP2 X-Received: by 2002:a05:620a:10a2:b0:794:85b6:a549 with SMTP id af79cd13be357-794994cf894mr332576385a.67.1716428914824; Wed, 22 May 2024 18:48:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716428914; cv=none; d=google.com; s=arc-20160816; b=jGsiDxdRMLt7zT9ys4oLYHF9Otn/lmtpRM5/NDGEvIyaWvR6S/hBxEeJPDfKmGyuNu ON6B2EM2VWlFi0qZ9DpkwwC0kmeO8/MBXm6GeV7smtIg8FNkfqhvlabE08wOorRm1oBN jgEvvuqt2NUfuifyVjIiv8eYY79pSVbip9FVvoXcrELAg/3smXcTj7++AY5dmIBiHywa T5TdNB76kaIrabqYgG6PZ5AE6iQlh9U3xr+gi1y+YD+5MqazfDtVTS45v5MzjAb4QRin /rsuj5etKgSYGT6y/ASo+Gks3dMQSxZcwUnqHIISm+0iQ2CFoFGZSFgCJdbgAo1xlE+E inAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature:delivered-to; bh=OUqJrGW+h8SjiT9ykyyTSHN8WyoT1WE3A6oRYPpUnMA=; fh=xYkst1351HdxJpVn+aDOJfMAHrKlAdcbZbZgF6iSq8Q=; b=hDzJKxWdxpsbEBjOxEbQVLxTfTb3rgyY4VtzbGVG7BWGjTaLqm5kzkP3mNZauJ70ox ua+vMjcxrhULqI0yFqdlGk2dD0czCrOZYcIcLvFnLYydy28P+pEANRGaJmghlU8eeE8u cMt+n4H81lk1hAyXZ878/Vo9/ITKQ1JiJzAaR8w9jflLR/gsV6EdgpmqrIQwJ7RYG0bB 2Pzy8aYF2jsfQdGU3Nw7s5WyjXLzqaYDk7i8PMWLuDN/X6nIxMG69wOVWrR4Eo8EffCP RzQXhbvc+z5w+KoXWWMsTZLT+i4ydhqzUKyPyZWdG/d1K58WKT5JElscFHv/8hVwPs3m J+0A==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@gibson.dropbear.id.au header.s=202312 header.b=HbE+flYR; spf=pass (google.com: domain of dgibson@gandalf.ozlabs.org designates 150.107.74.76 as permitted sender) smtp.mailfrom=dgibson@gandalf.ozlabs.org Return-Path: Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com. [205.139.110.120]) by mx.google.com with ESMTPS id af79cd13be357-7930321204dsi1593760285a.196.2024.05.22.18.48.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 18:48:34 -0700 (PDT) Received-SPF: pass (google.com: domain of dgibson@gandalf.ozlabs.org designates 150.107.74.76 as permitted sender) client-ip=150.107.74.76; Authentication-Results: mx.google.com; dkim=temperror (no key for signature) header.i=@gibson.dropbear.id.au header.s=202312 header.b=HbE+flYR; spf=pass (google.com: domain of dgibson@gandalf.ozlabs.org designates 150.107.74.76 as permitted sender) smtp.mailfrom=dgibson@gandalf.ozlabs.org Received: from mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-652-9Z8031ThNx2ENkMTPKDSaA-1; Wed, 22 May 2024 21:48:32 -0400 X-MC-Unique: 9Z8031ThNx2ENkMTPKDSaA-1 Received: from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 1934C19560A1 for ; Thu, 23 May 2024 01:48:31 +0000 (UTC) Received: by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) id 082F51955DA8; Thu, 23 May 2024 01:48:31 +0000 (UTC) Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.23]) by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 059721955D97 for ; Thu, 23 May 2024 01:48:31 +0000 (UTC) Received: from us-smtp-inbound-delivery-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id ADE151955DC7 for ; Thu, 23 May 2024 01:48:30 +0000 (UTC) Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-604-74vfiPnbOtuprzxHIb49Ng-1; Wed, 22 May 2024 21:48:25 -0400 X-MC-Unique: 74vfiPnbOtuprzxHIb49Ng-1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1716428901; bh=OUqJrGW+h8SjiT9ykyyTSHN8WyoT1WE3A6oRYPpUnMA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HbE+flYR6tWqBdQNu540emqx5dj6W02ZHBqtmf619bIkVH6ZpsxG+0NEHOqSnXpXL i1QFgH8f7BiCmB57JVMy/C8G7ERhksPaJvhJpO2fE0vfWW6ePHW7/8OdA8UBLFFWmk 86fo3BJPzwfrCO+OEVnTHABQW5dFHOCcfDzpnGW5cNfWa/qYBO4hmPtDDV+x0NaKvN 7QhYi15EDXX30Rz3pgB1gGWGUNvCod4qM1P9fyRZntJxRQ4QI6CYVlkSVIRs6OdT0n JCo7go9HbzRi1Ijr3jA0QYOThOCO1G2b54sOOoI7JKPMbCL9wYP9hKns6tnciqmJMz ugmjjD/XLj2sg== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4VlB050fDqz4wcq; Thu, 23 May 2024 11:48:21 +1000 (AEST) Date: Thu, 23 May 2024 11:46:57 +1000 From: David Gibson To: Stefano Brivio Cc: passt-dev@passt.top, "'Richard W . M . Jones'" , Minxi Hou Subject: Re: [PATCH 2/8] tap: Move all-ones initialisation of mac_guest to tap_sock_init() Message-ID: References: <20240522205911.261325-1-sbrivio@redhat.com> <20240522205911.261325-3-sbrivio@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="TiKb4T4UkCBrB1nb" Content-Disposition: inline In-Reply-To: <20240522205911.261325-3-sbrivio@redhat.com> X-Scanned-By: MIMEDefang 3.0 on 10.30.177.12 List-Id: --TiKb4T4UkCBrB1nb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 22, 2024 at 10:59:05PM +0200, Stefano Brivio wrote: > It has nothing to do with tap_sock_unix_init(). It used to be there as > that function could be called multiple times per passt instance, but > it's not the case anymore. >=20 > This also takes care of the fact that, with --fd, we wouldn't set the > initial MAC address, so we would need to wait for the guest to send us > an ARP packet before we could exchange data. >=20 > Fixes: 6b4e68383c66 ("passt, tap: Add --fd option") > Signed-off-by: Stefano Brivio Reviewed-by: David Gibson > --- > tap.c | 12 ++++++------ > 1 file changed, 6 insertions(+), 6 deletions(-) >=20 > diff --git a/tap.c b/tap.c > index 91fd2e2..177fe26 100644 > --- a/tap.c > +++ b/tap.c > @@ -1111,12 +1111,6 @@ static void tap_sock_unix_init(struct ctx *c) > if (fd < 0) > die("UNIX socket: %s", strerror(errno)); > =20 > - /* In passt mode, we don't know the guest's MAC until it sends > - * us packets. Use the broadcast address so our first packets > - * will reach it. > - */ > - memset(&c->mac_guest, 0xff, sizeof(c->mac_guest)); > - > for (i =3D 1; i < UNIX_SOCK_MAX; i++) { > char *path =3D addr.sun_path; > int ex, ret; > @@ -1312,6 +1306,12 @@ void tap_sock_init(struct ctx *c) > if (c->mode =3D=3D MODE_PASST) { > if (c->fd_tap_listen =3D=3D -1) > tap_sock_unix_init(c); > + > + /* In passt mode, we don't know the guest's MAC address until it > + * sends us packets. Use the broadcast address so that our > + * first packets will reach it. > + */ > + memset(&c->mac_guest, 0xff, sizeof(c->mac_guest)); > } else { > tap_sock_tun_init(c); > } --=20 David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson --TiKb4T4UkCBrB1nb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmZOoBAACgkQzQJF27ox 2Gf+Ug/+IVplHHlsO56Fz9XujgJxYNULlk5UNz9khjTXWpiefS5gK5V79yu02viZ 51moLwI/G+Je0NrcuZpbf9HtOMdi593sCTSNwm29k+ganKYZiTdfEUPF+iP4n37b W85OA3nIg15r5xqjsFIwAUvWEzXAnEO6DfDSJRgF0u1y6n/lHIkPe3il7+zs7mH2 kZyR5u5fI03XPhca6aLh8Rs0DohJ5Vr7L+6X5Rhf/eSd3rK0eP2WG5C1tsLgs/Nh UMG/tFa2rPWLQvfB43ZcLgNeR77OHYsoW5QUMiNlondD6U+B4nGACNFxRNajjKGh 9+e4Mx00rmwtYFuBUYcM91MDfXPCr3VPQeiPa6kooDWf2dzG6x+lx7MlkVNS0+LI nnTwjJGSIhbZrtJHXpVByxQ8gqmPa5r5uFl9NwL465VJWkHOPq0KcXLqR+lD1jvv CAGmWBFNwWbmBquALfQgcVjvGlM8w0ny+F1RcC6nNmCTRcqfFZIh6lMKFl2DqlMw v6/j+Stkc8/iazVtpHHSDSU0FoXbDvJZjHaKQ5VKIfwRg2lwnhfb0sIGo5carrxS xNsy44bWC2eE2yFMMZpB9VdOCaOYcHK1ghcWpTvrR7n8PAXCGDH/BpihqZxflheJ oiLxCNcLfNtajsMXwuAEOfQZCB6s61zi8VUtmZO1ylX7XwJpew4= =r7aE -----END PGP SIGNATURE----- --TiKb4T4UkCBrB1nb--