← Back to team overview

kernel-packages team mailing list archive

[Bug 1509894] Re: Cannot include "netinet/in.h" with "linux/netfilter/nf_nat.h" and "sys/capability.h"

 

apport information

** Tags added: apport-collected wily

** Description changed:

  I expect to be able to compile the following program (and indeed I am
  able to compile it on Ubuntu release before 15.10):
  
  ```
  // test.c
  #include "sys/capability.h"
  #include "netinet/in.h"
  #include "linux/netfilter/nf_nat.h"
  
  int main() {
    // Program that needs to call capset() and htonl(), and also needs
    // to do some netfilter things with NF_ACCEPT...
  }
  ```
  
  However, on 15.10 I get a bunch of errors:
  
  
  ```
  $ gcc test.c
  In file included from test.c:3:0:
  /usr/include/linux/in.h:28: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.  */
       ^
  ...
  ```
  
  This bug breaks the build for Sandstorm on Ubuntu 15.10:
  https://github.com/sandstorm-io/sandstorm/issues/1049
  
  
  ```
  $ lsb_release -rd
  Description:	Ubuntu 15.10
  Release:	15.10
  
  $ apt-cache policy linux-libc-dev
  linux-libc-dev:
    Installed: 4.2.0-16.19
    Candidate: 4.2.0-16.19
    Version table:
   *** 4.2.0-16.19 0
          500 http://us.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
          100 /var/lib/dpkg/status
  ```
+ --- 
+ AlsaVersion: Advanced Linux Sound Architecture Driver Version k4.2.0-16-generic.
+ AplayDevices: Error: [Errno 2] No such file or directory
+ ApportVersion: 2.19.1-0ubuntu3
+ Architecture: amd64
+ ArecordDevices: Error: [Errno 2] No such file or directory
+ AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/pcmC0D1c', '/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/controlC0', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
+ Card0.Amixer.info: Error: [Errno 2] No such file or directory
+ Card0.Amixer.values: Error: [Errno 2] No such file or directory
+ DistroRelease: Ubuntu 15.10
+ HibernationDevice: RESUME=UUID=875556b7-c0a8-46ab-9060-d2cd1999c0ac
+ InstallationDate: Installed on 2015-10-19 (6 days ago)
+ InstallationMedia: Ubuntu-Server 15.10 "Wily Werewolf" - Alpha amd64 (20150924)
+ IwConfig:
+  enp0s8    no wireless extensions.
+  
+  enp0s3    no wireless extensions.
+  
+  lo        no wireless extensions.
+ Lsusb:
+  Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
+  Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
+ MachineType: innotek GmbH VirtualBox
+ Package: linux (not installed)
+ ProcEnviron:
+  TERM=xterm-256color
+  PATH=(custom, no user)
+  XDG_RUNTIME_DIR=<set>
+  LANG=en_US.UTF-8
+  SHELL=/bin/bash
+ ProcFB:
+  
+ ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.2.0-16-generic root=UUID=4ca984fb-5723-4616-8ecb-838c0c1d92a2 ro
+ ProcVersionSignature: Ubuntu 4.2.0-16.19-generic 4.2.3
+ RelatedPackageVersions:
+  linux-restricted-modules-4.2.0-16-generic N/A
+  linux-backports-modules-4.2.0-16-generic  N/A
+  linux-firmware                            1.149
+ RfKill: Error: [Errno 2] No such file or directory
+ Tags:  wily wily
+ UdevLog: Error: [Errno 2] No such file or directory: '/var/log/udev'
+ Uname: Linux 4.2.0-16-generic x86_64
+ UnreportableReason: The report belongs to a package that is not installed.
+ UpgradeStatus: No upgrade log present (probably fresh install)
+ UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
+ _MarkForUpload: True
+ dmi.bios.date: 12/01/2006
+ dmi.bios.vendor: innotek GmbH
+ dmi.bios.version: VirtualBox
+ dmi.board.name: VirtualBox
+ dmi.board.vendor: Oracle Corporation
+ dmi.board.version: 1.2
+ dmi.chassis.type: 1
+ dmi.chassis.vendor: Oracle Corporation
+ dmi.modalias: dmi:bvninnotekGmbH:bvrVirtualBox:bd12/01/2006:svninnotekGmbH:pnVirtualBox:pvr1.2:rvnOracleCorporation:rnVirtualBox:rvr1.2:cvnOracleCorporation:ct1:cvr:
+ dmi.product.name: VirtualBox
+ dmi.product.version: 1.2
+ dmi.sys.vendor: innotek GmbH

** Attachment added: "AlsaDevices.txt"
   https://bugs.launchpad.net/bugs/1509894/+attachment/4505042/+files/AlsaDevices.txt

-- 
You received this bug notification because you are a member of Kernel
Packages, which is subscribed to linux in Ubuntu.
https://bugs.launchpad.net/bugs/1509894

Title:
  Cannot include "netinet/in.h" with "linux/netfilter/nf_nat.h" and
  "sys/capability.h"

Status in linux package in Ubuntu:
  Confirmed

Bug description:
  I expect to be able to compile the following program (and indeed I am
  able to compile it on Ubuntu release before 15.10):

  ```
  // test.c
  #include "sys/capability.h"
  #include "netinet/in.h"
  #include "linux/netfilter/nf_nat.h"

  int main() {
    // Program that needs to call capset() and htonl(), and also needs
    // to do some netfilter things with NF_ACCEPT...
  }
  ```

  However, on 15.10 I get a bunch of errors:

  
  ```
  $ gcc test.c
  In file included from test.c:3:0:
  /usr/include/linux/in.h:28: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.  */
       ^
  ...
  ```

  This bug breaks the build for Sandstorm on Ubuntu 15.10:
  https://github.com/sandstorm-io/sandstorm/issues/1049


  ```
  $ lsb_release -rd
  Description:	Ubuntu 15.10
  Release:	15.10

  $ apt-cache policy linux-libc-dev
  linux-libc-dev:
    Installed: 4.2.0-16.19
    Candidate: 4.2.0-16.19
    Version table:
   *** 4.2.0-16.19 0
          500 http://us.archive.ubuntu.com/ubuntu/ wily/main amd64 Packages
          100 /var/lib/dpkg/status
  ```
  --- 
  AlsaVersion: Advanced Linux Sound Architecture Driver Version k4.2.0-16-generic.
  AplayDevices: Error: [Errno 2] No such file or directory
  ApportVersion: 2.19.1-0ubuntu3
  Architecture: amd64
  ArecordDevices: Error: [Errno 2] No such file or directory
  AudioDevicesInUse: Error: command ['fuser', '-v', '/dev/snd/by-path', '/dev/snd/pcmC0D1c', '/dev/snd/pcmC0D0c', '/dev/snd/pcmC0D0p', '/dev/snd/controlC0', '/dev/snd/seq', '/dev/snd/timer'] failed with exit code 1:
  Card0.Amixer.info: Error: [Errno 2] No such file or directory
  Card0.Amixer.values: Error: [Errno 2] No such file or directory
  DistroRelease: Ubuntu 15.10
  HibernationDevice: RESUME=UUID=875556b7-c0a8-46ab-9060-d2cd1999c0ac
  InstallationDate: Installed on 2015-10-19 (6 days ago)
  InstallationMedia: Ubuntu-Server 15.10 "Wily Werewolf" - Alpha amd64 (20150924)
  IwConfig:
   enp0s8    no wireless extensions.
   
   enp0s3    no wireless extensions.
   
   lo        no wireless extensions.
  Lsusb:
   Bus 001 Device 002: ID 80ee:0021 VirtualBox USB Tablet
   Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
  MachineType: innotek GmbH VirtualBox
  Package: linux (not installed)
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   XDG_RUNTIME_DIR=<set>
   LANG=en_US.UTF-8
   SHELL=/bin/bash
  ProcFB:
   
  ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.2.0-16-generic root=UUID=4ca984fb-5723-4616-8ecb-838c0c1d92a2 ro
  ProcVersionSignature: Ubuntu 4.2.0-16.19-generic 4.2.3
  RelatedPackageVersions:
   linux-restricted-modules-4.2.0-16-generic N/A
   linux-backports-modules-4.2.0-16-generic  N/A
   linux-firmware                            1.149
  RfKill: Error: [Errno 2] No such file or directory
  Tags:  wily wily
  UdevLog: Error: [Errno 2] No such file or directory: '/var/log/udev'
  Uname: Linux 4.2.0-16-generic x86_64
  UnreportableReason: The report belongs to a package that is not installed.
  UpgradeStatus: No upgrade log present (probably fresh install)
  UserGroups: adm cdrom dip lpadmin plugdev sambashare sudo
  _MarkForUpload: True
  dmi.bios.date: 12/01/2006
  dmi.bios.vendor: innotek GmbH
  dmi.bios.version: VirtualBox
  dmi.board.name: VirtualBox
  dmi.board.vendor: Oracle Corporation
  dmi.board.version: 1.2
  dmi.chassis.type: 1
  dmi.chassis.vendor: Oracle Corporation
  dmi.modalias: dmi:bvninnotekGmbH:bvrVirtualBox:bd12/01/2006:svninnotekGmbH:pnVirtualBox:pvr1.2:rvnOracleCorporation:rnVirtualBox:rvr1.2:cvnOracleCorporation:ct1:cvr:
  dmi.product.name: VirtualBox
  dmi.product.version: 1.2
  dmi.sys.vendor: innotek GmbH

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1509894/+subscriptions


References