From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UFR8YEpy; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTP id 28A465A004E for ; Wed, 27 Nov 2024 15:48:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1732718895; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/xeN6cFP7iUPICH+zIFU5MLdn5DbhHuLLna1WtD4Bfk=; b=UFR8YEpygLi0sOVv5vq0tij8VsBRh+6HCp0RZowE8B9Nz/szPag00t0w3WQInw0BRj5pjj j5+Z+xfbua/clxid8E0Bh75hD/4kxFc+AVsUjOLLXAm7uSC0dHXob27MohbfiLzxj46QJT 7asb983B8C173jUifteJdJgmE/gnhMc= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-411-LK3NNd88PZmJL3946On0fw-1; Wed, 27 Nov 2024 09:48:13 -0500 X-MC-Unique: LK3NNd88PZmJL3946On0fw-1 X-Mimecast-MFC-AGG-ID: LK3NNd88PZmJL3946On0fw Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-43499c1342aso29836805e9.1 for ; Wed, 27 Nov 2024 06:48:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732718891; x=1733323691; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=/xeN6cFP7iUPICH+zIFU5MLdn5DbhHuLLna1WtD4Bfk=; b=jsjkrJZ4id1IbMb8W+AKaRlvLuRgaxFUE4z3o2fMapZiNS6sK8eYc/amqJe/GYGH7N DKHQH8YQRL5vp427/HjCbPUMklvtsIu+QxjEfVUaaXSx/ukZRdtXqfQHU/Osd/kbWh24 EafkCck9awzMOx7YNIOsvfc97ZdEEyAh/s/K+oPMJChdyK/3xxdMew/Ov8BiELHmiCNi AtuLbCkXb5QDkFGlRf5wmgI5g6wL2PSnLJ446+oEzN+ILrQmhjeyXaOzCYE4VYBinvaU iu5VVxmkF+wF2NbCgnESEwqG3B9m1f0joikxrvjcD7dZC+rfhkzGRyyyiJn3jEv8+nca 573g== X-Gm-Message-State: AOJu0Yxm5ACqMqZ9vbRYwSQACj+lb8gSSpYMQntnwQwqKRE50kft8Kq1 yHCWUlJCbvgcZop7zvEAwwl4MPiHbOjdWnlGXD/Hj758zS0aoeZ1/yc0Dv+gKSHeI3bVYng0Ojj GyNMxjfUVSu5riZIPwLcE43NLSo1+fEpJiItFBFGXfk1GjBlgXcgQ2fgYnthzsOhkWa4z73dynh q9bzwCTHNU2RwtoHWpI7qgb8Qn5iE1opBM X-Gm-Gg: ASbGnctFasmD0veikoay3v84eNztfXwzsrpF8Ik3/1uzjNU1Kd90yDlsZvtsgTiuPM1 fdxtgen/K+hEz2X17SK8vSvGEfsx7mXxt8ajXPkoz2+7yAAzpi0Mws/5z68FVkONDNtndiCJkHv EbuXAkGyPiHOpQJVnwmvsS8REJvYEWuk1b6oJvAL08dybcbjZ6J2uckHCU4qdaf9CmQZF1PtAVl QRLMwZqasJvovvdj05H0pVKAZCUOYDxmK5sq+kMHsgXdSlAUSmrrLXzPMnbigwHdzP66CCfUMf+ nQA= X-Received: by 2002:a05:600c:314a:b0:434:a902:415b with SMTP id 5b1f17b1804b1-434a9dc3c69mr36414845e9.10.1732718891360; Wed, 27 Nov 2024 06:48:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IFrSRSCI2PFQHU0+a0pFCZrEp04ELVv/mjP/uDlZrA+NHdXAXKw9yE1IgQLpSmB+gPOW0P2cQ== X-Received: by 2002:a05:600c:314a:b0:434:a902:415b with SMTP id 5b1f17b1804b1-434a9dc3c69mr36414595e9.10.1732718891007; Wed, 27 Nov 2024 06:48:11 -0800 (PST) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [176.103.220.4]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-434aa7d26b5sm22938075e9.35.2024.11.27.06.48.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Nov 2024 06:48:10 -0800 (PST) Date: Wed, 27 Nov 2024 15:48:09 +0100 From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH] musl: fix conflict on ethhdr definition Message-ID: <20241127154809.2a49f2f8@elisabeth> In-Reply-To: <20241127144130.3637798-1-lvivier@redhat.com> References: <20241127144130.3637798-1-lvivier@redhat.com> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 9okpmzWb708mkNTyQMrr-6nSqe3c4So0HwGZCiSp-2c_1732718893 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: I6JS7AFU4CX5CDGJLYVMTI7AA3Q47YKA X-Message-ID-Hash: I6JS7AFU4CX5CDGJLYVMTI7AA3Q47YKA X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Wed, 27 Nov 2024 15:41:30 +0100 Laurent Vivier wrote: > there is a conflict between netinet/if_ether.h provided by musl and > linux/if_ether.h provided by the linux headers: > > In file included from passt.h:185, > from tcp_vu.c:21: > /usr/include/netinet/if_ether.h:115:8: error: redefinition of 'struct ethhdr' > 115 | struct ethhdr { > | ^~~~~~ > In file included from /usr/include/linux/virtio_net.h:32, > from tcp_vu.c:17: > /usr/include/linux/if_ether.h:173:8: note: originally defined here > 173 | struct ethhdr { > | ^~~~~~ > > The kernel headers provide a flag to disable the definition in this case, > __UAPI_DEF_ETHHDR (see /usr/include/linux/if_ether.h comment). > > Signed-off-by: Laurent Vivier > --- > Makefile | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/Makefile b/Makefile > index cb7448079de5..2aa56ada65fd 100644 > --- a/Makefile > +++ b/Makefile > @@ -33,6 +33,9 @@ FLAGS += $(FORTIFY_FLAG) -O2 -pie -fPIE > FLAGS += -DPAGE_SIZE=$(shell getconf PAGE_SIZE) > FLAGS += -DVERSION=\"$(VERSION)\" > FLAGS += -DDUAL_STACK_SOCKETS=$(DUAL_STACK_SOCKETS) > +ifeq (musl, $(word 4,$(subst -, ,$(TARGET)))) > +FLAGS += -D__UAPI_DEF_ETHHDR=0 > +endif Uh oh, I just solved this locally (I was about to push, but I stopped in time) by simply including instead of from passt.h. I'm not sure what's the best solution: mine is simpler, but I'm not really fond of including Linux-specific stuff if there's no need for it, so I'd slightly prefer yours. On the other hand, it's not just for musl. If somebody tries to build this against, say, uClibc-ng (no reports about that yet), they will probably run into trouble as well. Or should we just unconditionally #define __UAPI_DEF_ETHHDR=0 just before including ? -- Stefano