After binding the socket to the interface, we don't need to check
if the incoming packet belongs to the wanted interface, so remove
the check and the parameter.
Signed-off-by: Vitezslav Samel <vitezslav(a)samel.cz>
---
src/hostmon.c | 2 +-
src/ifstats.c | 4 ++--
src/itrafmon.c | 2 +-
src/packet.c | 9 +--------
src/packet.h | 2 +-
src/pktsize.c | 2 +-
src/serv.c | 2 +-
7 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/src/hostmon.c b/src/hostmon.c
index e64ab9c..d61967d 100644
--- a/src/hostmon.c
+++ b/src/hostmon.c
@@ -872,7 +872,7 @@ void hostmon(const struct OPTIONS *options, int facilitytime, char
*ifptr,
NULL, NULL, NULL, &fromaddr,
ofilter,
MATCH_OPPOSITE_USECONFIG, ifname,
- ifptr, 0);
+ 0);
if (pkt_result != PACKET_OK)
continue;
diff --git a/src/ifstats.c b/src/ifstats.c
index 74beb97..c8fec55 100644
--- a/src/ifstats.c
+++ b/src/ifstats.c
@@ -562,7 +562,7 @@ void ifstats(const struct OPTIONS *options, struct filterstate
*ofilter,
NULL, NULL, NULL, &fromaddr,
ofilter,
MATCH_OPPOSITE_USECONFIG,
- ifname, NULL, options->v6inv4asv6);
+ ifname, options->v6inv4asv6);
if (pkt_result != PACKET_OK
&& pkt_result != MORE_FRAGMENTS)
@@ -1013,7 +1013,7 @@ void detstats(char *iface, const struct OPTIONS *options, int
facilitytime,
NULL, NULL, NULL, &fromaddr,
ofilter,
MATCH_OPPOSITE_USECONFIG, ifname,
- iface, options->v6inv4asv6);
+ options->v6inv4asv6);
if (pkt_result != PACKET_OK
&& pkt_result != MORE_FRAGMENTS)
diff --git a/src/itrafmon.c b/src/itrafmon.c
index 85f2781..597f82c 100644
--- a/src/itrafmon.c
+++ b/src/itrafmon.c
@@ -1150,7 +1150,7 @@ void ipmon(struct OPTIONS *options, struct filterstate *ofilter,
(unsigned int *) &readlen, &br,
&sport, &dport, &fromaddr,
ofilter, MATCH_OPPOSITE_ALWAYS,
- ifname, ifptr, options->v6inv4asv6);
+ ifname, options->v6inv4asv6);
if (pkt_result != PACKET_OK)
continue;
diff --git a/src/packet.c b/src/packet.c
index dec3166..c168019 100644
--- a/src/packet.c
+++ b/src/packet.c
@@ -153,15 +153,8 @@ int processpacket(char *tpacket, char **packet, unsigned int *br,
unsigned int *total_br, unsigned int *sport,
unsigned int *dport, struct sockaddr_ll *fromaddr,
struct filterstate *filter,
- int match_opposite, char *ifname, char *ifptr, int v6inv4asv6)
+ int match_opposite, char *ifname, int v6inv4asv6)
{
- /*
- * Does returned interface (ifname) match the specified interface name
- * (ifptr)?
- */
- if (ifptr && strcmp(ifptr, ifname) != 0)
- return INVALID_PACKET;
-
#if 0 /* reenable isdn */
/*
* Prepare ISDN reference descriptor and table.
diff --git a/src/packet.h b/src/packet.h
index 1497bad..22f9a67 100644
--- a/src/packet.h
+++ b/src/packet.h
@@ -32,7 +32,7 @@ int processpacket(char *tpacket, char **packet, unsigned int *br,
unsigned int *total_br, unsigned int *sport,
unsigned int *dport, struct sockaddr_ll *fromaddr,
struct filterstate *ofilter,
- int match_opposite, char *ifname, char *ifptr, int v6inv4asv6);
+ int match_opposite, char *ifname, int v6inv4asv6);
void pkt_cleanup(void);
#endif /* IPTRAF_NG_PACKET_H */
diff --git a/src/pktsize.c b/src/pktsize.c
index 88be980..a1e747f 100644
--- a/src/pktsize.c
+++ b/src/pktsize.c
@@ -318,7 +318,7 @@ void packet_size_breakdown(struct OPTIONS *options, char *ifname,
NULL, NULL, NULL, &fromaddr,
ofilter,
MATCH_OPPOSITE_USECONFIG, iface,
- ifname, 0);
+ 0);
if (pkt_result != PACKET_OK)
continue;
diff --git a/src/serv.c b/src/serv.c
index 8ea2f04..cdb7738 100644
--- a/src/serv.c
+++ b/src/serv.c
@@ -1057,7 +1057,7 @@ void servmon(char *ifname, struct porttab *ports, const struct
OPTIONS *options,
&tot_br, &sport, &dport, &fromaddr,
ofilter,
MATCH_OPPOSITE_USECONFIG, iface,
- ifname, options->v6inv4asv6);
+ options->v6inv4asv6);
if (pkt_result != PACKET_OK)
continue;
--
1.7.8.4