Bug 1239213 - iptables: can't link against libiptc
Summary: iptables: can't link against libiptc
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 24
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: 1240533
TreeView+ depends on / blocked
 
Reported: 2015-07-04 12:54 UTC by Ruben Kerkhof
Modified: 2016-06-09 20:18 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2016-06-09 20:18:22 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1300256 0 unspecified CLOSED Including <libiptc/libiptc.h> results to redeclaration of enumerator ‘IFF_UP’ in /usr/include/linux/if.h 2021-02-22 00:41:40 UTC

Internal Links: 1300256

Description Ruben Kerkhof 2015-07-04 12:54:31 UTC
Description of problem:

The following code fails:

#include <libiptc/libiptc.h>

void main() {
}

ruben@wodan: iptables-test$ gcc test.c 
In file included from /usr/include/netinet/ip.h:24:0,
                 from /usr/include/libiptc/ipt_kernel_headers.h:9,
                 from /usr/include/libiptc/libiptc.h:6,
                 from test.c:1:
/usr/include/linux/in.h:26:3: error: redeclaration of enumerator ‘IPPROTO_IP’
   IPPROTO_IP = 0,  /* Dummy protocol for TCP  */
   ^
/usr/include/netinet/in.h:42:5: note: previous definition of ‘IPPROTO_IP’ was here
     IPPROTO_IP = 0,    /* Dummy protocol for TCP.  */
     ^

and lots more.

It seems that both the glibc headers and the kernel headers are included by libiptc.h, and they both define IPPROTO_IP and co.


Version-Release number of selected component (if applicable):
ruben@wodan: ~$ rpm -q iptables
iptables-1.4.21-15.fc23.x86_64
ruben@wodan: ~$ uname -r
4.2.0-0.rc0.git4.1.fc23.x86_64


This breaks collectd's iptables plugin.

Comment 1 Petr Pisar 2015-07-07 08:45:48 UTC
This happens when upgrading kernel-headers from 4.1.0-1.fc23 to 4.2.0-0.rc0.git1.1.fc23.

Comment 2 Jan Kurik 2015-07-15 13:50:39 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 3 Jan Kurik 2016-02-24 13:25:19 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 24 development cycle.
Changing version to '24'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/Fedora_Program_Management/HouseKeeping/Fedora24#Rawhide_Rebase

Comment 4 Thomas Woerner 2016-04-13 16:47:11 UTC
This has been fixed in kernel headers and is not an issue anymore.

Comment 5 Petr Pisar 2016-04-14 06:49:33 UTC
Are you sure? 

# rpm -q iptables-devel kernel-headers
iptables-devel-1.6.0-1.fc25.x86_64
kernel-headers-4.6.0-0.rc3.git0.1.fc25.x86_64

# printf '#include <libiptc/libiptc.h>\n' | gcc -c -x c -
In file included from /usr/include/libiptc/ipt_kernel_headers.h:13:0,
                 from /usr/include/libiptc/libiptc.h:6,
                 from <stdin>:1:
/usr/include/linux/if.h:71:2: error: redeclaration of enumerator ‘IFF_UP’
  IFF_UP    = 1<<0,  /* sysfs */
  ^

Comment 6 Thomas Woerner 2016-04-14 14:14:27 UTC
Oups, this is an issue in F25, still.

I am sorry for closing.

Comment 7 Thomas Woerner 2016-05-09 13:42:40 UTC
Reassigning to kernel. See #1300256.

Comment 8 Pavel Šimerda (pavlix) 2016-05-09 13:46:37 UTC
(In reply to Thomas Woerner from comment #7)
> Reassigning to kernel. See #1300256.

A duplicate now?

Comment 9 Ruben Kerkhof 2016-06-09 20:18:22 UTC
Since https://bugzilla.redhat.com/show_bug.cgi?id=1300256, which is actually a duplicate of this bug, has been fixed, let's close this too.


Note You need to log in before you can comment on or make changes to this bug.