diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-04-03 11:27:59 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-04-03 11:27:59 +0000 |
commit | c484dd14bbe1e4ea73959e359f38f6fc8a67f183 (patch) | |
tree | d5bec04bdcfb4ba24a4aa2c9749dd9db97b66388 /sbin | |
parent | a1635befe23560ba64eac8beb3c7b95bcd1af3af (diff) |
handle unknown option too. All this ipoption handling needs rewriting, I now see a whole bunch more flaws
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/ping/ping.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sbin/ping/ping.c b/sbin/ping/ping.c index 6f00a47ad17..7337aaaa44e 100644 --- a/sbin/ping/ping.c +++ b/sbin/ping/ping.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ping.c,v 1.29 1998/04/02 20:52:53 deraadt Exp $ */ +/* $OpenBSD: ping.c,v 1.30 1998/04/03 11:27:58 deraadt Exp $ */ /* $NetBSD: ping.c,v 1.20 1995/08/11 22:37:58 cgd Exp $ */ /* @@ -47,7 +47,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93"; #else -static char rcsid[] = "$OpenBSD: ping.c,v 1.29 1998/04/02 20:52:53 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: ping.c,v 1.30 1998/04/03 11:27:58 deraadt Exp $"; #endif #endif /* not lint */ @@ -618,7 +618,7 @@ pr_pack(buf, cc, from) register struct icmp *icp; register in_addr_t l; register u_int i, j; - register u_char *cp,*dp; + register u_char *cp, *dp; static int old_rrlen; static char old_rr[MAX_IPOPTLEN]; struct ip *ip, *ip2; @@ -810,6 +810,8 @@ pr_pack(buf, cc, from) break; default: (void)printf("\nunknown option %x", *cp); + hlen = hlen + cp[1] - 1; + cp = cp + cp[1] - 1; break; } if (!(options & F_FLOOD)) { |