Files
operating-system/buildroot/package/netsniff-ng/0006-mausezahn-move-variable-definitions-from-mz-h-to-mausezahn-c.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

185 lines
4.8 KiB
Diff

From 56f8f399a20275a4a73ebc4450bd8eeba7ee1656 Mon Sep 17 00:00:00 2001
From: Tobias Klauser <tklauser@distanz.ch>
Date: Wed, 19 Aug 2020 13:13:54 +0200
Subject: [PATCH] mausezahn: move variable definitions from mz.h to mausezahn.c
Move variable definitions to avoid "multiple definition of symbol"
linker errors with gcc-10.
Fixes #216
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
[Retrieved from:
https://github.com/netsniff-ng/netsniff-ng/commit/56f8f399a20275a4a73ebc4450bd8eeba7ee1656]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
staging/mausezahn.c | 46 ++++++++++++++++++++++++++++++++++++++++
staging/mz.h | 51 +++++++++++++++++++++++++--------------------
2 files changed, 74 insertions(+), 23 deletions(-)
diff --git a/staging/mausezahn.c b/staging/mausezahn.c
index 19d2937a..cae57a1b 100644
--- a/staging/mausezahn.c
+++ b/staging/mausezahn.c
@@ -32,8 +32,54 @@
#include "die.h"
#include "dev.h"
+enum operating_modes mode;
+
+int ipv6_mode;
+int quiet; // don't even print 'important standard short messages'
+int verbose; // report character
+int simulate; // if 1 then don't really send frames
+
+char path[256];
+char filename[256];
+FILE *fp, *fp2; // global multipurpose file pointer
+
+long double total_d;
+clock_t mz_start, mz_stop;
+
+int mz_rand;
+int bwidth;
+
+int32_t
+ jitter[TIME_COUNT_MAX];
+
+int
+ rtp_log,
+ time0_flag, // If set then time0 has valid data
+ sqnr0_flag;
+
+u_int8_t
+ mz_ssrc[4]; // holds RTP stream identifier for rcv_rtp()
+
+u_int16_t
+ sqnr_cur,
+ sqnr_last,
+ sqnr_next;
+
+u_int32_t
+ gind, // a global index to run through deltaRX, deltaTX, and jitter
+ gind_max; // the amount of entries used in the (ugly oversized) arrays; per default set to TIME_COUNT
+
+struct tx_struct tx; // NOTE: tx elements are considered as default values for MOPS
+
+struct device_struct device_list[MZ_MAX_DEVICES];
+
+int device_list_entries;
+
int verbose_level = 0;
+char mz_default_config_path[256];
+char mz_default_log_path[256];
+
static const char *short_options = "46hqvVSxra:A:b:B:c:d:E:f:F:l:p:P:R:t:T:M:Q:X:";
static void signal_handler(int number)
diff --git a/staging/mz.h b/staging/mz.h
index 42e64cfc..33e74e60 100644
--- a/staging/mz.h
+++ b/staging/mz.h
@@ -108,8 +108,8 @@ static inline void verbose_l2(const char *format, ...)
#define IPADDRSIZE 46
-char mz_default_config_path[256];
-char mz_default_log_path[256];
+extern char mz_default_config_path[256];
+extern char mz_default_log_path[256];
struct arp_table_struct {
@@ -159,9 +159,11 @@ struct device_struct
struct pcap *p_arp; // pcap handle
struct arp_table_struct *arp_table; // dedicated ARP table
int ps; // packet socket
-} device_list[MZ_MAX_DEVICES];
+};
+
+extern struct device_struct device_list[MZ_MAX_DEVICES];
-int device_list_entries;
+extern int device_list_entries;
#pragma pack(1)
@@ -270,46 +272,47 @@ enum operating_modes
SYSLOG,
LLDP,
IGMP
-} mode;
+};
+extern enum operating_modes mode;
-int ipv6_mode;
-int quiet; // don't even print 'important standard short messages'
-int verbose; // report character
-int simulate; // if 1 then don't really send frames
+extern int ipv6_mode;
+extern int quiet; // don't even print 'important standard short messages'
+extern int verbose; // report character
+extern int simulate; // if 1 then don't really send frames
-char path[256];
-char filename[256];
-FILE *fp, *fp2; // global multipurpose file pointer
+extern char path[256];
+extern char filename[256];
+extern FILE *fp, *fp2; // global multipurpose file pointer
-long double total_d;
-clock_t mz_start, mz_stop;
+extern long double total_d;
+extern clock_t mz_start, mz_stop;
-int mz_rand;
-int bwidth;
+extern int mz_rand;
+extern int bwidth;
struct mz_timestamp {
u_int32_t sec;
u_int32_t nsec;
};
-int32_t
- jitter[TIME_COUNT_MAX];
+extern int32_t
+ jitter[TIME_COUNT_MAX];
-int
+extern int
rtp_log,
time0_flag, // If set then time0 has valid data
sqnr0_flag;
-u_int8_t
+extern u_int8_t
mz_ssrc[4]; // holds RTP stream identifier for rcv_rtp()
-u_int16_t
+extern u_int16_t
sqnr_cur,
sqnr_last,
sqnr_next;
-u_int32_t
+extern u_int32_t
gind, // a global index to run through deltaRX, deltaTX, and jitter
gind_max; // the amount of entries used in the (ugly oversized) arrays; per default set to TIME_COUNT
@@ -476,7 +479,9 @@ struct tx_struct
rtp_sqnr,
rtp_stmp;
-} tx; // NOTE: tx elements are considered as default values for MOPS
+};
+
+extern struct tx_struct tx; // NOTE: tx elements are considered as default values for MOPS
// ************************************
//