diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-03-22 05:33:31 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1999-03-22 05:33:31 +0000 |
commit | 6047d40e0585b358e74c4020f4064765c930e9d4 (patch) | |
tree | 6e0b56eceec35b33a13a351a46ad4e1754d699eb | |
parent | aa8d91e7780805ee15e1b64fd6e1eac949a7ea7b (diff) |
set default if to something more reasonable; fix SIGSEGV when no options listed; garath@ntplx.net
-rw-r--r-- | usr.sbin/ipsend/ipsend/ipsend.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ipsend/ipsend/ipsend.c b/usr.sbin/ipsend/ipsend/ipsend.c index af87ff1410e..a026bb2863e 100644 --- a/usr.sbin/ipsend/ipsend/ipsend.c +++ b/usr.sbin/ipsend/ipsend/ipsend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ipsend.c,v 1.5 1998/01/26 04:17:04 dgregor Exp $ */ +/* $OpenBSD: ipsend.c,v 1.6 1999/03/22 05:33:30 deraadt Exp $ */ /* * ipsend.c (C) 1995-1997 Darren Reed * @@ -13,7 +13,7 @@ */ #if !defined(lint) static const char sccsid[] = "@(#)ipsend.c 1.5 12/10/95 (C)1995 Darren Reed"; -static const char rcsid[] = "@(#)$Id: ipsend.c,v 1.5 1998/01/26 04:17:04 dgregor Exp $"; +static const char rcsid[] = "@(#)$Id: ipsend.c,v 1.6 1999/03/22 05:33:30 deraadt Exp $"; #endif #include <stdio.h> #include <stdlib.h> @@ -47,13 +47,13 @@ int opts; #ifdef linux char default_device[] = "eth0"; #else -# ifdef sun +# if defined(sun) || defined(__OpenBSD__) char default_device[] = "le0"; # else # ifdef ultrix char default_device[] = "ln0"; # else -# ifdef __bsdi__ +# ifdef __bsdi__ char default_device[] = "ef0"; # else # ifdef __sgi @@ -358,7 +358,7 @@ char **argv; tcp = (tcphdr_t *)((char *)(ip + 1) + olen); } - if (ip->ip_p == IPPROTO_TCP) + if (ip->ip_p == IPPROTO_TCP && optind < argc) for (s = argv[optind]; (c = *s); s++) switch(c) { |