Skip to content
Success

Changes

Summary

  1. src/l2tp_protocol.h: include netinet/in.h (details)
Commit a4b5e251766dded4d6f71dd4145307370d2305f0 by Oliver Smith
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,

   115
                = 115,

    IPPROTO_SCTP = 132,

    IPPROTO_UDPLITE = 136,

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

Change-Id: Iaec15ee59a1e740d41e616142637612d2aacf1dc
The file was modifiedsrc/l2tp_protocol.h