← Back to team overview

kernel-packages team mailing list archive

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

 

Public bug reported:

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
```

** Affects: linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
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:
  New

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
  ```

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


Follow ups