Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1966383

Summary: glibc: Header file conflict between <netinet/in.h> and <linux/icmp.h> as the result of RFC 8335 PROBE support
Product: Red Hat Enterprise Linux 9 Reporter: Chunyu Hu <chuhu>
Component: glibcAssignee: glibc team <glibc-bugzilla>
Status: CLOSED WORKSFORME QA Contact: qe-baseos-tools-bugs
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.0CC: ashankar, codonell, dj, fweimer, liwan, mnewsome, pfrankli, sipoyare
Target Milestone: betaKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-11-25 23:57:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chunyu Hu 2021-06-01 03:12:49 UTC
Description of problem:

When compiling trinity in latest rhel9, there's conflicts between netinet headers and linux-headers, which should be resolved, otherwise some use may be affected

Version-Release number of selected component (if applicable):
glibc-headers-2.33-13.el9.x86_64

rpm -qf /usr/include/linux/libc-compat.h 
kernel-headers-5.13.0-0.rc3.25.el9.x86_64

How reproducible:
always

Steps to Reproduce:
1. git clone https://github.com/kernelslacker/trinity.git
2. ./configure
3. make -j $(nproc)

Actual results:
conflicts showed, and compile broken:

  CC	net/proto-irda.o
In file included from include/net.h:5,
                 from net/proto-ip-raw.c:2:
/usr/include/netinet/in.h:31:8: error: redefinition of ‘struct in_addr’
   31 | struct in_addr
      |        ^~~~~~~
In file included from /usr/include/linux/icmp.h:23,
                 from net/proto-ip-raw.c:1:
/usr/include/linux/in.h:89:8: note: originally defined here
   89 | struct in_addr {
      |        ^~~~~~~
In file included from /usr/include/netinet/in.h:37,
                 from include/net.h:5,
                 from net/proto-ip-raw.c:2:
/usr/include/bits/in.h:150:8: error: redefinition of ‘struct ip_mreqn’
  150 | struct ip_mreqn
      |        ^~~~~~~~
In file included from /usr/include/linux/icmp.h:23,
                 from net/proto-ip-raw.c:1:
/usr/include/linux/in.h:178:8: note: originally defined here
  178 | struct ip_mreqn {
      |        ^~~~~~~~
In file included from /usr/include/netinet/in.h:37,
                 from include/net.h:5,
                 from net/proto-ip-raw.c:2:
/usr/include/bits/in.h:158:8: error: redefinition of ‘struct in_pktinfo’
  158 | struct in_pktinfo


Expected results:
UAPI

Additional info:

From /usr/include/linux/libc-compat.h :

 *
 * This fixes the situation where the linux headers are included *after* the
 * libc headers. To fix the problem with the inclusion in the other order the
 * userspace libc headers must be fixed like this:
 *
 * * For all definitions that conflict with kernel definitions wrap those
 *   defines in the following:
 *   #if !__UAPI_DEF_FOO
 *     ...
 *   #endif
 *
 * This prevents the redefinition of a construct already defined by the kernel.

Comment 2 Florian Weimer 2021-06-02 18:00:03 UTC
Reported upstream: https://lore.kernel.org/netdev/87im2wup0m.fsf@oldenburg.str.redhat.com/

Comment 4 Florian Weimer 2021-06-18 13:06:05 UTC
Upstream UAPI patch submission: https://lore.kernel.org/netdev/20210603212211.335237-1-andreas.a.roeseler@gmail.com/

Comment 5 Florian Weimer 2021-11-25 18:25:15 UTC
I see the kernel patch made it into the tree?

commit e32ea44c7ae476f4c90e35ab0a29dc8ff082bc11
Author: Andreas Roeseler <andreas.a.roeseler>
Date:   Thu Jun 3 16:22:11 2021 -0500

    icmp: fix lib conflict with trinity
    
    Including <linux/in.h> and <netinet/in.h> in the dependencies breaks
    compilation of trinity due to multiple definitions. <linux/in.h> is only
    used in <linux/icmp.h> to provide the definition of the struct in_addr,
    but this can be substituted out by using the datatype __be32.
    
    Signed-off-by: Andreas Roeseler <andreas.a.roeseler>
    Signed-off-by: David S. Miller <davem>

Chunyu Hu, may we close this bug? Thanks.

Comment 6 Chunyu Hu 2021-11-25 23:57:32 UTC
(In reply to Florian Weimer from comment #5)
> I see the kernel patch made it into the tree?
> 
> commit e32ea44c7ae476f4c90e35ab0a29dc8ff082bc11
> Author: Andreas Roeseler <andreas.a.roeseler>
> Date:   Thu Jun 3 16:22:11 2021 -0500
> 
>     icmp: fix lib conflict with trinity
>     
>     Including <linux/in.h> and <netinet/in.h> in the dependencies breaks
>     compilation of trinity due to multiple definitions. <linux/in.h> is only
>     used in <linux/icmp.h> to provide the definition of the struct in_addr,
>     but this can be substituted out by using the datatype __be32.
>     
>     Signed-off-by: Andreas Roeseler <andreas.a.roeseler>
>     Signed-off-by: David S. Miller <davem>
> 
> Chunyu Hu, may we close this bug? Thanks.

Thanks for info. Close this.