I attach the patch to correctly restore terminal when not using a byte
sized mask, I have also sent it to the package maintainer in order to
include it for the next package revision.


About the "silly netmask restriction" i will try to fix it in the next
upstream version of netdsicover.

Anyway due to the nature of active scanning, when forging an ARP
request paket a source MAC & IP address must be supplied, and choosing
source IP address should be carefully done, because if the selected
source IP is being used by another computer in the network, the other
computer could be isolated from the network, as the requests being
sent by netdiscover will overwrite arp caches from the others
computers in the network, also under switched environments this can
cause inaccurate results if the supplanted computer sends any ARP
reply/request while the scan is in process.

I explain this because that is the main reason to avoid non byte size
netmasks,  mainly for networks smaller than 255 hosts. If the computer
used to scan for example a /28 network actually has an address
assigned for that network, there wouldn't be any problem, as the same
address could be used for the scan, but if you don't know the network
addressing and you are searching for it, then choosing a random source
address (in such small networks) can produce inaccurate results and
cause temporary malfunctions on the network.

So under those circumstances i would recommend the passive mode
instead of active scanning the network.

Probably as much as i could do is to allow scanning networks smaller
than /24 just when the computer already has an IP address assigned for
the network being scanned. Any suggestions to solve this problem are
welcome.

In a few words, when doing "blind" scanning, as less hosts are
delimited by the netmask, chances to "hit" an used address increase.

Sorry for the explanation, but English isn't my mother language.


About the bug, i think that fixing the terminal restore is enough to
close this bug, because the netmask restriction would fit better under
the scope of feature request than under bug scope.


Regards,
Jaime.
diff -urN netdiscover-0.3-beta6/src/main.c netdiscover-0.3-beta6-rev2/src/main.c
--- netdiscover-0.3-beta6/src/main.c	2005-10-23 01:38:04.000000000 +0200
+++ netdiscover-0.3-beta6-rev2/src/main.c	2008-04-08 00:19:38.000000000 +0200
@@ -380,7 +380,7 @@
 	{
 		system("clear");
 		printf("Network range must be 0.0.0.0/8 , /16 or /24\n");
-		exit(1);
+		sighandler(0);
 	}
 	
 }

Reply via email to