From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson To: passt-dev@passt.top Subject: Re: [PATCH 3/8] passt.h: Include netinet/if_ether.h before struct ctx declaration Date: Fri, 07 Oct 2022 19:40:43 +1100 Message-ID: In-Reply-To: <20221007094417.44e4fbfd@elisabeth> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6358747399926569988==" --===============6358747399926569988== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On Fri, Oct 07, 2022 at 09:44:17AM +0200, Stefano Brivio wrote: > On Fri, 7 Oct 2022 17:23:30 +1100 > David Gibson wrote: > > > On Fri, Oct 07, 2022 at 02:47:37AM +0200, Stefano Brivio wrote: > > > This saves some hassle when including passt.h, as we need ETH_ALEN > > > there. > > > > > > Signed-off-by: Stefano Brivio > > > > Hrm. So I had the impression that passt was using the convention that > > it's the top level files responsibility to include all the > > dependencies for a header before including the header, rather than > > having headers include other headers they need. Was I mistaken? I'm > > ok with either model, they each have their advantages, but I find > > sticking to one or the other is generally better than a mix of both. > > That was my original idea, but it's a bit of a disaster, because it > turns out we need and a few others pretty much > everywhere, even though the file at hand will never see an Ethernet > header. :( > > Does this indicate that it's time to move struct ctx out of passt.h > (and similarly with other structs here and there)? Well.. really we want to break struct ctx up so it's not globals by another name, but that's not news. > Or that we should switch to the other way around? I don't really have > an answer. > > If you have some ideas for a possible guideline/policy, I'd be happy to > refactor includes based on that... > -- 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 --===============6358747399926569988== Content-Type: application/pgp-signature Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="signature.asc" MIME-Version: 1.0 LS0tLS1CRUdJTiBQR1AgU0lHTkFUVVJFLS0tLS0KCmlRSXpCQUVCQ0FBZEZpRUVvVUx4V3U0L1dz MGRCK1h0Z3lwWTRnRXdZU0lGQW1NLzVnUUFDZ2tRZ3lwWTRnRXcKWVNKeE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