osmith submitted this change.

View Change

Approvals: laforge: Looks good to me, but someone else must approve Jenkins Builder: Verified osmith: Looks good to me, approved fixeria: Looks good to me, but someone else must approve
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(-)

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 change 41184. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-el2tpd
Gerrit-Branch: master
Gerrit-Change-Id: Iaec15ee59a1e740d41e616142637612d2aacf1dc
Gerrit-Change-Number: 41184
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: Hoernchen <ewild@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>