summarylogtreecommitdiffstats
path: root/04-bandwidthd-misc.patch
blob: f830a1df01d53f87a74af66fba9761afca688de4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c
--- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/bandwidthd.c	2019-03-27 20:05:31.000000000 +0100
+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/bandwidthd.c	2020-04-09 11:23:31.431948002 +0200
@@ -120,6 +120,7 @@
 	int NumGraphs = 0;
 	pid_t graphpid;
 	int Counter;
+	int niceness __attribute__((unused));
 	/* Did we catch any packets since last time? */
 	if (!DataStore) 
 		return -2;
@@ -136,7 +137,7 @@
 			monstartup((u_long) &_start, (u_long) &etext);
 #endif
 			signal(SIGHUP, SIG_IGN);
-			nice(4); // reduce priority so I don't choke out other tasks
+			niceness = nice(4); // reduce priority so I don't choke out other tasks
 			// Count Number of IP's in datastore
 			for (DataStore = IPDataStore, Counter = 0; DataStore; Counter++, DataStore = DataStore->Next);
 			// +1 because we don't want to accidently allocate 0
@@ -256,6 +257,7 @@
 	int ForkBackground = TRUE;
 	int ListDevices = FALSE;
 	int Counter;
+	int niceness __attribute__((unused));
 	char *bd_conf = NULL;
 	struct in_addr addr, addr2;
 	signal(SIGHUP, SIG_IGN);
@@ -480,7 +482,7 @@
 	// This is also set in CloseInterval because it gets overwritten in some commit modules
 	signal(SIGALRM, handle_interval);
 	alarm(config.interval);
-	nice(1);
+	niceness = nice(1);
 	while (1)
 		{
 		// Bookeeping
@@ -610,7 +612,7 @@
 	int AlreadyTotaled = FALSE;
 	PacketCallbackLock = TRUE;
 	eptr = (struct ether_header *) p;
-	vlanhdr = (struct vlanhdr *) p;
+	vlanhdr = (struct VlanHeader *) p;
 	if (eptr->ether_type == htons(1537))
 		ParseBroadcast(p);
 	if (vlanhdr->ether_type[0]==0x81 && vlanhdr->ether_type[1]==0x00) //Two byte-wise checks instead of 1 word-wise check to avoid word boundary issues on some intel processors
diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/graph.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/graph.c
--- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/graph.c	2019-03-27 20:05:31.000000000 +0100
+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/graph.c	2020-04-09 11:21:50.611498930 +0200
@@ -387,7 +387,7 @@
 	FILE *OutputFile;
 	char filename[MAX_FILENAME];
 	gdImagePtr im, im2;
-	int white;
+	int white __attribute__((unused));
 	unsigned long long int YMax;
 	char CharIp[20];
 
@@ -489,7 +489,9 @@
 	char Buffer2[50];
 	
 	int blue, lblue, orange, red, yellow, purple, green, brown, black;
-	int blue2, lblue2, orange2, red2, yellow2, purple2, green2, brown2, black2;
+	int blue2, lblue2;
+	int orange2 __attribute__((unused));
+	int red2, yellow2, purple2, green2, brown2, black2;
 
 	unsigned long long int SentPeak = 0;
 	unsigned long long int ReceivedPeak = 0;
@@ -802,7 +804,8 @@
 	{
 	char buffer[100];
 	int black, red;
-	time_t sample_begin, sample_end;	
+	time_t sample_begin;
+	time_t sample_end __attribute__((unused));
 	struct tm *timestruct;
 	long int MarkTime;
 	long int MarkTimeStep;
diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/pgsql.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/pgsql.c
--- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/pgsql.c	2019-03-27 20:05:31.000000000 +0100
+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/pgsql.c	2020-04-09 11:24:13.432131299 +0200
@@ -471,10 +471,12 @@
 	}
 #endif
 
+#ifdef HAVE_LIBPQ
 static void pgsqllngjmp(int signal)
 	{
 	longjmp(pgsqljmp, 1);	
 	}
+#endif
 
 void pgsqlStoreIPData(struct IPData IncData[], struct extensions *extension_data)
 	{
diff -u bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/sqlite.c bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/sqlite.c
--- bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef/sqlite.c	2019-03-27 20:05:31.000000000 +0100
+++ bandwidthd-0307fbba56a39a6e65ebadf488ad87979c64fdef~/sqlite.c	2020-04-09 11:27:57.313078710 +0200
@@ -250,7 +250,7 @@
 
 	time_t now;
 
-	if (!config.output_database == DB_SQLITE)
+	if (config.output_database != DB_SQLITE)
 		return;
 
 	// ************ Inititialize the db if it's not already