Blame SOURCES/arpwatch-zero-source-ip.patch
|
|
8501a5 |
--- a/arpwatch.c 2017-03-22 08:44:22.095722636 +0100
|
|
|
8501a5 |
+++ b/arpwatch.c 2017-03-22 09:11:08.119515745 +0100
|
|
|
8501a5 |
@@ -123,6 +123,7 @@ struct nets {
|
|
|
8501a5 |
static struct nets *nets;
|
|
|
8501a5 |
static int nets_ind;
|
|
|
8501a5 |
static int nets_size;
|
|
|
8501a5 |
+static int ignore_zero_net;
|
|
|
8501a5 |
|
|
|
8501a5 |
extern int optind;
|
|
|
8501a5 |
extern int opterr;
|
|
|
8501a5 |
@@ -477,6 +478,11 @@ process_ether(register u_char *u, regist
|
|
|
8501a5 |
/* Source ip address */
|
|
|
8501a5 |
BCOPY(SPA(ea), &sia, 4);
|
|
|
8501a5 |
|
|
|
8501a5 |
+ if (sia == 0 && ignore_zero_net) {
|
|
|
8501a5 |
+ syslog(LOG_DEBUG, "ignoring packet from 0.0.0.0");
|
|
|
8501a5 |
+ return;
|
|
|
8501a5 |
+ }
|
|
|
8501a5 |
+
|
|
|
8501a5 |
/* Watch for bogons */
|
|
|
8501a5 |
if (isbogon(sia)) {
|
|
|
8501a5 |
dosyslog(LOG_INFO, "bogon", sia, sea, sha);
|
|
|
8501a5 |
@@ -802,6 +808,9 @@ addnet(register const char *str)
|
|
|
8501a5 |
np->netmask = m;
|
|
|
8501a5 |
++nets_ind;
|
|
|
8501a5 |
|
|
|
8501a5 |
+ if (n == 0)
|
|
|
8501a5 |
+ ignore_zero_net = 1;
|
|
|
8501a5 |
+
|
|
|
8501a5 |
return (1);
|
|
|
8501a5 |
}
|
|
|
8501a5 |
|