Files
operating-system/buildroot/package/igd2-for-linux/0001-fix-build-with-gcc-10.patch
Stefan Agner a0871be6c0 Bump buildroot to 2020.11-rc1 (#985)
* Update buildroot-patches for 2020.11-rc1 buildroot

* Update buildroot to 2020.11-rc1

Signed-off-by: Stefan Agner <stefan@agner.ch>

* Don't rely on sfdisk --list-free output

The --list-free (-F) argument does not allow machine readable mode. And
it seems that the output format changes over time (different spacing,
using size postfixes instead of raw blocks).

Use sfdisk json output and calculate free partition space ourselfs. This
works for 2.35 and 2.36 and is more robust since we rely on output which
is meant for scripts to parse.

* Migrate defconfigs for Buildroot 2020.11-rc1

In particular, rename BR2_TARGET_UBOOT_BOOT_SCRIPT(_SOURCE) to
BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT(_SOURCE).

* Rebase/remove systemd patches for systemd 246

* Drop apparmor/libapparmor from buildroot-external

* hassos-persists: use /run as directory for lockfiles

The U-Boot tools use /var/lock by default which is not created any more
by systemd by default (it is under tmpfiles legacy.conf, which we no
longer install).

* Disable systemd-update-done.service

The service is not suited for pure read-only systems. In particular the
service needs to be able to write a file in /etc and /var. Remove the
service. Note: This is a static service and cannot be removed using
systemd-preset.

* Disable apparmor.service for now

The service loads all default profiles. Some might actually cause
problems. E.g. the profile for ping seems not to match our setup for
/etc/resolv.conf:
[85503.634653] audit: type=1400 audit(1605286002.684:236): apparmor="DENIED" operation="open" profile="ping" name="/run/resolv.conf" pid=27585 comm="ping" requested_mask="r" denied_mask="r" fsuid=0 ouid=0
2020-11-13 18:25:44 +01:00

200 lines
6.2 KiB
Diff

From 23ed73623810a0894c8efd9eb79dd38483794a3b Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fabrice.fontaine@orange.com>
Date: Thu, 20 Aug 2020 18:17:03 +0200
Subject: [PATCH] fix build with gcc 10
This will fix build failures with -fno-common which is enabled by
default with gcc 10
Fixes:
- http://autobuild.buildroot.org/results/f296984c3851fc28341210e36ef1b55b2edac209
Signed-off-by: Fabrice Fontaine <fabrice.fontaine@orange.com>
[Retrieved from:
https://github.com/Orange-OpenSource/igd2-for-linux/commit/23ed73623810a0894c8efd9eb79dd38483794a3b]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
linuxigd2/src/gatedevice.c | 37 +++++++++++++++++++++++++++++++++
linuxigd2/src/gatedevice.h | 42 +++++++++-----------------------------
linuxigd2/src/pinholev6.c | 2 ++
linuxigd2/src/pinholev6.h | 2 +-
linuxigd2/src/pmlist.c | 5 +++++
linuxigd2/src/pmlist.h | 2 +-
linuxigd2/src/wanipv6fw.h | 3 ---
7 files changed, 56 insertions(+), 37 deletions(-)
diff --git a/linuxigd2/src/gatedevice.c b/linuxigd2/src/gatedevice.c
index 8be53e5..a50525d 100644
--- a/linuxigd2/src/gatedevice.c
+++ b/linuxigd2/src/gatedevice.c
@@ -41,6 +41,43 @@
#include "wanipv6fw.h"
#include "config.h"
+// Thread which contains all kind of timers and threads used in gatedevice.c and deviceprotection.c
+TimerThread gExpirationTimerThread;
+
+// IGD Device Globals
+UpnpDevice_Handle deviceHandle;
+UpnpDevice_Handle deviceHandleIPv6;
+UpnpDevice_Handle deviceHandleIPv6UlaGua;
+char *gateUDN;
+char *wanUDN;
+char *wanConnectionUDN;
+char *lanUDN;
+long int startup_time;
+unsigned long connection_stats[STATS_LIMIT]; // this is used for defining if connection is in idling
+long int idle_time;
+
+// State Variables
+char ConnectionType[50];
+char PossibleConnectionTypes[50];
+char ConnectionStatus[20];
+char LastConnectionError[35];
+long int AutoDisconnectTime;
+long int IdleDisconnectTime;
+long int WarnDisconnectDelay;
+int RSIPAvailable;
+int NATEnabled;
+char ExternalIPAddress[INET6_ADDRSTRLEN];
+int PortMappingNumberOfEntries;
+int PortMappingEnabled;
+char RemoteHost[INET6_ADDRSTRLEN]; // updated IPv6 addrss length 16 -> 46
+long int SystemUpdateID;
+
+// WANEthLinkConfig state variables
+char EthernetLinkStatus[12];
+
+char FirewallEnabled[2];
+char InboundPinholeAllowed[2];
+
//Definitions for mapping expiration timer thread
static ThreadPool gExpirationThreadPool;
static ThreadPoolJob gEventUpdateJob;
diff --git a/linuxigd2/src/gatedevice.h b/linuxigd2/src/gatedevice.h
index 28d6b21..dbaa0c2 100644
--- a/linuxigd2/src/gatedevice.h
+++ b/linuxigd2/src/gatedevice.h
@@ -33,42 +33,20 @@
#include "util.h"
// Thread which contains all kind of timers and threads used in gatedevice.c and deviceprotection.c
-TimerThread gExpirationTimerThread;
+extern TimerThread gExpirationTimerThread;
// IGD Device Globals
-UpnpDevice_Handle deviceHandle;
-UpnpDevice_Handle deviceHandleIPv6;
-UpnpDevice_Handle deviceHandleIPv6UlaGua;
-char *gateUDN;
-char *wanUDN;
-char *wanConnectionUDN;
-char *lanUDN;
-long int startup_time;
-unsigned long connection_stats[STATS_LIMIT]; // this is used for defining if connection is in idling
-long int idle_time;
-
-// State Variables
-char ConnectionType[50];
-char PossibleConnectionTypes[50];
-char ConnectionStatus[20];
-char LastConnectionError[35];
-long int AutoDisconnectTime;
-long int IdleDisconnectTime;
-long int WarnDisconnectDelay;
-int RSIPAvailable;
-int NATEnabled;
-char ExternalIPAddress[INET6_ADDRSTRLEN];
-int PortMappingNumberOfEntries;
-int PortMappingEnabled;
-char RemoteHost[INET6_ADDRSTRLEN]; // updated IPv6 addrss length 16 -> 46
-long int SystemUpdateID;
-
-// WANEthLinkConfig state variables
-char EthernetLinkStatus[12];
+extern UpnpDevice_Handle deviceHandle;
+extern UpnpDevice_Handle deviceHandleIPv6;
+extern UpnpDevice_Handle deviceHandleIPv6UlaGua;
+extern char *gateUDN;
+extern char *wanUDN;
+extern char *wanConnectionUDN;
+extern char *lanUDN;
// Linked list for portmapping entries
-struct portMap *pmlist_Head;
-struct portMap *pmlist_Current;
+extern struct portMap *pmlist_Head;
+extern struct portMap *pmlist_Current;
// WanIPConnection Actions
int EventHandler(Upnp_EventType EventType, void *Event, void *Cookie);
diff --git a/linuxigd2/src/pinholev6.c b/linuxigd2/src/pinholev6.c
index 44e8a19..78f886d 100644
--- a/linuxigd2/src/pinholev6.c
+++ b/linuxigd2/src/pinholev6.c
@@ -41,6 +41,8 @@ extern "C" {
#include "gatedevice.h"
#include "pinholev6.h"
+struct pinholev6 *ph_first;
+
static const char * add_rule_str = "ip6tables -I %s " //upnp forward chain
"-i %s " //input interface
"-o %s " //output interface
diff --git a/linuxigd2/src/pinholev6.h b/linuxigd2/src/pinholev6.h
index 295b9f9..353ae27 100644
--- a/linuxigd2/src/pinholev6.h
+++ b/linuxigd2/src/pinholev6.h
@@ -37,7 +37,7 @@ struct pinholev6 {
struct pinholev6 *next;
-} *ph_first;
+};
struct phv6_expirationEvent
{
diff --git a/linuxigd2/src/pmlist.c b/linuxigd2/src/pmlist.c
index 1b3fe05..95d0c61 100644
--- a/linuxigd2/src/pmlist.c
+++ b/linuxigd2/src/pmlist.c
@@ -41,6 +41,11 @@
#include "iptc.h"
#endif
+// Linked list for portmapping entries
+struct portMap *pmlist_Head;
+struct portMap *pmlist_Current;
+struct portMap *pmlist_Tail;
+
/**
* Create new portMap struct of rule to add iptables.
* portMap-struct is internal presentation of iptables rule in IGD.
diff --git a/linuxigd2/src/pmlist.h b/linuxigd2/src/pmlist.h
index 436d228..017500d 100644
--- a/linuxigd2/src/pmlist.h
+++ b/linuxigd2/src/pmlist.h
@@ -57,7 +57,7 @@ struct portMap
struct portMap* next;
struct portMap* prev;
-} *pmlist_Head, *pmlist_Tail, *pmlist_Current;
+};
//struct portMap* pmlist_NewNode(void);
struct portMap* pmlist_NewNode(int enabled, long int duration, char *remoteHost,
diff --git a/linuxigd2/src/wanipv6fw.h b/linuxigd2/src/wanipv6fw.h
index 55419fe..a50d267 100644
--- a/linuxigd2/src/wanipv6fw.h
+++ b/linuxigd2/src/wanipv6fw.h
@@ -46,9 +46,6 @@ extern "C" {
#define ERR_SRC_ADD_WILDCARD 708
#define ERR_NO_TRAFFIC 709
-char FirewallEnabled[2];
-char InboundPinholeAllowed[2];
-
//-----------------------------------------------------------------------------
int InitFirewallv6(void);