osmith has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-el2tpd/+/41184?usp=email )


Change subject: src/l2tp_protocol.h: include netinet/in.h
......................................................................

src/l2tp_protocol.h: include netinet/in.h

Fix the following error seen in the master-osmo-el2tpd jenkins job after
switching it to debian 13:

  In file included from l2tpd_lapd.c:31:
  l2tp_protocol.h:28:25: error: expected identifier before numeric constant
     28 | #define IPPROTO_L2TP    115

This happens, because /usr/include/netinet/in.h has:

  /* Standard well-defined IP protocols.  */
  enum
    {
      IPPROTO_IP = 0,      /* Dummy protocol for TCP.  */
  #define IPPROTO_IP            IPPROTO_IP
      IPPROTO_ICMP = 1,    /* Internet Control Message Protocol.  */
  #define IPPROTO_ICMP          IPPROTO_ICMP
  …
      IPPROTO_COMP = 108,          /* Compression Header Protocol.  */
  #define IPPROTO_COMP          IPPROTO_COMP
      IPPROTO_L2TP = 115,          /* Layer 2 Tunnelling Protocol.  */
  #define IPPROTO_L2TP          IPPROTO_L2TP
  …
    };

Which then becomes (seen with gcc -E):

      IPPROTO_COMP = 108,

  # 84 "/usr/include/netinet/in.h"
     115
  # 84 "/usr/include/netinet/in.h" 3 4
                  = 115,

      IPPROTO_SCTP = 132,

Fix this by including netinet/in.h first, so it won't be redefined if it
is already there.

Change-Id: Iaec15ee59a1e740d41e616142637612d2aacf1dc
---
M src/l2tp_protocol.h
1 file changed, 2 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-el2tpd refs/changes/84/41184/1

diff --git a/src/l2tp_protocol.h b/src/l2tp_protocol.h
index 32821f5..6b9fe55 100644
--- a/src/l2tp_protocol.h
+++ b/src/l2tp_protocol.h
@@ -24,6 +24,8 @@
  *
  */

+#include "netinet/in.h"
+
 #ifndef IPPROTO_L2TP
 #define IPPROTO_L2TP   115
 #endif

--
To view, visit https://gerrit.osmocom.org/c/osmo-el2tpd/+/41184?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: osmo-el2tpd
Gerrit-Branch: master
Gerrit-Change-Id: Iaec15ee59a1e740d41e616142637612d2aacf1dc
Gerrit-Change-Number: 41184
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <[email protected]>

Reply via email to