diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2016-12-09 09:46:29 +0100 |
---|---|---|
committer | Tobias Klauser <tklauser@distanz.ch> | 2016-12-09 09:46:29 +0100 |
commit | 19fd2e57dc963f0e26e625645ee6a922cf3aed2f (patch) | |
tree | 4046b95e7d750188df1bea76d8b48645a9489a86 | |
parent | 51e487b4b55a69581f2d27cbf148ff98c173eaf7 (diff) |
Revert "mausezahn: Add error handling for mismatched address families"
This reverts commit bf0df3ec1875df4b167aedd0fff25e7e56408b6b.
It turns out, just checking for "." in the IPv4 source will prevent the
user from providing an FQDN (which is explicitely allowed and
supported). Also, an FQDN would be a valid argument for the IPv6 source,
so the check for ":" is also not sufficient.
Reference: #166
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
-rw-r--r-- | staging/mausezahn.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/staging/mausezahn.c b/staging/mausezahn.c index 7acd6bc..ec3bc0e 100644 --- a/staging/mausezahn.c +++ b/staging/mausezahn.c @@ -671,15 +671,6 @@ int getopts (int argc, char *argv[]) tx.ip_src_rand = 1; tx.ip_src_h = (u_int32_t) ( ((float) rand()/RAND_MAX)*0xE0000000); //this is 224.0.0.0 } - else if (ipv6_mode && (strstr(tx.ip_src_txt, ".") || strstr(tx.ip_dst_txt, "."))) { - fprintf(stderr, "You are using IPv6 mode but are providing IPv4 src/dst addresses.\n"); - return 1; - } - else if (!ipv6_mode && (strstr(tx.ip_src_txt, ":") || strstr(tx.ip_dst_txt, ":"))) { - fprintf(stderr, "You are using IPv4 mode (the default) but are providing IPv6 src/dst addresses.\n"); - fprintf(stderr, "Please use the -6 option for IPv6 mode.\n"); - return 1; - } else if ( (ipv6_mode && get_ip6_range_src(tx.ip_src_txt, l)) || // returns 1 when no range has been specified (!ipv6_mode && get_ip_range_src(tx.ip_src_txt)) @@ -901,7 +892,7 @@ int main(int argc, char **argv) if ( getopts(argc, argv) ) { - (void) fprintf(stderr, "Invalid command line parameters!\n"); + (void) fprintf(stderr, " Invalid command line parameters!\n"); help(); } |