|
@@ -1,12 +1,12 @@
|
|
|
Subject: Cherry-pick 1.4.0-11-g4ea2db6 ff. to fix sprintf usage
|
|
|
-Author: James Cameron <quozl@laptop.org>
|
|
|
-Date: Thu Oct 16 08:22:36 2014 +1100
|
|
|
Origin:
|
|
|
commit 4ea2db6028cc1079aa84ac1b92e23ba8a7ce9d8e
|
|
|
commit 2521c45c19106722f299c66d4e0ef86ff7486b54
|
|
|
commit eee8ad1adece7cc5dfcadaa3cf838cfaf0b01b05
|
|
|
+Author: James Cameron <quozl@laptop.org>
|
|
|
+Date: Thu Oct 16 08:22:36 2014 +1100
|
|
|
Bug-Debian: https://bugs.debian.org/765442
|
|
|
-Last-Update: 2014-10-25
|
|
|
+Last-Update: 2015-08-24
|
|
|
|
|
|
--- a/bcrelay.c
|
|
|
+++ b/bcrelay.c
|
|
@@ -165,7 +165,7 @@ Last-Update: 2014-10-25
|
|
|
#define MAX_IFLOGTOSTR 16
|
|
|
|
|
|
/* Local function prototypes */
|
|
|
-@@ -152,15 +166,13 @@ struct packet {
|
|
|
+@@ -152,15 +166,13 @@
|
|
|
|
|
|
|
|
|
/*
|
|
@@ -186,7 +186,7 @@ Last-Update: 2014-10-25
|
|
|
int index;
|
|
|
u_int32_t bcast;
|
|
|
char ifname[16+1];
|
|
|
-@@ -176,10 +188,10 @@ struct iflist {
|
|
|
+@@ -176,10 +188,10 @@
|
|
|
|
|
|
|
|
|
/*
|
|
@@ -201,7 +201,7 @@ Last-Update: 2014-10-25
|
|
|
*/
|
|
|
struct ifsnr {
|
|
|
int sock_nr;
|
|
|
-@@ -198,7 +210,7 @@ static void bind_to_iface(int fd, int if
|
|
|
+@@ -198,7 +210,7 @@
|
|
|
|
|
|
/*
|
|
|
* This global variable determines whether NVBCR_PRINTF actually
|
|
@@ -210,7 +210,7 @@ Last-Update: 2014-10-25
|
|
|
* printf and a lot of tracing/logging/debugging was done with these.
|
|
|
* Of course, by default these 'info' messages have been turned off
|
|
|
* now. Enable by setting variable to 1. Note that output will only
|
|
|
-@@ -209,100 +221,100 @@ static int do_org_info_printfs = 0;
|
|
|
+@@ -209,100 +221,100 @@
|
|
|
static int vnologging = 0;
|
|
|
static int vdaemon = 0;
|
|
|
|
|
@@ -380,7 +380,7 @@ Last-Update: 2014-10-25
|
|
|
#endif
|
|
|
}
|
|
|
#endif
|
|
|
-@@ -321,78 +333,81 @@ int main(int argc, char **argv) {
|
|
|
+@@ -321,78 +333,81 @@
|
|
|
exit(1);
|
|
|
#endif
|
|
|
|
|
@@ -527,7 +527,7 @@ Last-Update: 2014-10-25
|
|
|
}
|
|
|
|
|
|
// If specified, become Daemon.
|
|
|
-@@ -426,7 +441,6 @@ static void mainloop(int argc, char **ar
|
|
|
+@@ -426,7 +441,6 @@
|
|
|
{
|
|
|
socklen_t salen = sizeof(struct sockaddr_ll);
|
|
|
int i, s, rcg, j, no_discifs_cntr, ifs_change;
|
|
@@ -535,7 +535,7 @@ Last-Update: 2014-10-25
|
|
|
struct iflist *iflist = NULL; // Initialised after the 1st packet
|
|
|
struct sockaddr_ll sa;
|
|
|
struct packet *ipp_p;
|
|
|
-@@ -436,7 +450,10 @@ static void mainloop(int argc, char **ar
|
|
|
+@@ -436,7 +450,10 @@
|
|
|
static struct ifsnr old_ifsnr[MAXIF+1]; // Old iflist to socket fd's mapping list
|
|
|
static struct ifsnr cur_ifsnr[MAXIF+1]; // Current iflist to socket fd's mapping list
|
|
|
unsigned char buf[1518];
|
|
@@ -547,7 +547,7 @@ Last-Update: 2014-10-25
|
|
|
|
|
|
no_discifs_cntr = MAX_NODISCOVER_IFS;
|
|
|
ifs_change = 0;
|
|
|
-@@ -449,7 +466,8 @@ static void mainloop(int argc, char **ar
|
|
|
+@@ -449,7 +466,8 @@
|
|
|
|
|
|
|
|
|
/*
|
|
@@ -557,7 +557,7 @@ Last-Update: 2014-10-25
|
|
|
*/
|
|
|
memset(old_ifsnr, -1, sizeof(old_ifsnr));
|
|
|
memset(cur_ifsnr, -1, sizeof(cur_ifsnr));
|
|
|
-@@ -464,313 +482,367 @@ static void mainloop(int argc, char **ar
|
|
|
+@@ -464,313 +482,367 @@
|
|
|
}
|
|
|
NVBCR_PRINTF(("Displaying INITIAL active interfaces..\n"));
|
|
|
if (vnologging == 0) {
|
|
@@ -1196,7 +1196,7 @@ Last-Update: 2014-10-25
|
|
|
}
|
|
|
|
|
|
// Discover active interfaces
|
|
|
-@@ -788,102 +860,102 @@ discoverActiveInterfaces(int s) {
|
|
|
+@@ -788,102 +860,102 @@
|
|
|
/* Reset ifs */
|
|
|
memset(&ifs, 0, sizeof(ifs));
|
|
|
|
|
@@ -1380,7 +1380,7 @@ Last-Update: 2014-10-25
|
|
|
|
|
|
iflist[cntr].index = 0; // Terminate list
|
|
|
free(ifs.ifc_req); // Stop that leak.
|
|
|
-@@ -934,28 +1006,33 @@ void ip_update_checksum(unsigned char *i
|
|
|
+@@ -934,28 +1006,33 @@
|
|
|
static char *IpProtToString( unsigned char prot )
|
|
|
{
|
|
|
switch( prot )
|
|
@@ -1430,7 +1430,7 @@ Last-Update: 2014-10-25
|
|
|
(ifp->ifdstaddr)&0x000000ff, ifp->flags1);
|
|
|
|
|
|
return str_tr;
|
|
|
-@@ -963,21 +1040,16 @@ static char *iflistToString( struct ifli
|
|
|
+@@ -963,21 +1040,16 @@
|
|
|
|
|
|
static char *iflistLogRToString( struct iflist *ifp, int idx, struct ifsnr *ifnr )
|
|
|
{
|
|
@@ -1457,7 +1457,7 @@ Last-Update: 2014-10-25
|
|
|
return str_tr;
|
|
|
}
|
|
|
|
|
|
-@@ -1001,10 +1073,10 @@ static void copy_ifsnr(struct ifsnr *fro
|
|
|
+@@ -1001,10 +1073,10 @@
|
|
|
int i;
|
|
|
|
|
|
for (i=0; i<MAXIF; ++i)
|
|
@@ -1472,7 +1472,7 @@ Last-Update: 2014-10-25
|
|
|
}
|
|
|
|
|
|
static int find_sock_nr(struct ifsnr *l, int ifidx)
|
|
|
-@@ -1016,4 +1088,3 @@ static int find_sock_nr(struct ifsnr *l,
|
|
|
+@@ -1016,4 +1088,3 @@
|
|
|
/* not found */
|
|
|
return -1;
|
|
|
}
|