From nobody@FreeBSD.ORG Sat Aug 21 08:57:24 1999
Return-Path: <nobody@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 32767)
	id 63EB514F10; Sat, 21 Aug 1999 08:57:24 -0700 (PDT)
Message-Id: <19990821155724.63EB514F10@hub.freebsd.org>
Date: Sat, 21 Aug 1999 08:57:24 -0700 (PDT)
From: thomma@slip.net
Sender: nobody@FreeBSD.ORG
To: freebsd-gnats-submit@freebsd.org
Subject: Ping -s <odd_size> does not work
X-Send-Pr-Version: www-1.0

>Number:         13292
>Category:       bin
>Synopsis:       Ping -s <odd_size> does not work
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Aug 21 09:00:01 PDT 1999
>Closed-Date:    Mon Nov 15 12:06:03 PST 1999
>Last-Modified:  Mon Nov 15 12:07:06 PST 1999
>Originator:     Tamiji Homma
>Release:        4.0-current
>Organization:
>Environment:
FreeBSD snoopy.pochi.com 4.0-CURRENT FreeBSD 4.0-CURRENT #73: Wed Aug 11 22:31:31 PDT 1999     root@snoopy.pochi.com:/usr/src/sys/compile/SNOOPY  i386
>Description:
ping command generates bad check sum for odd size icmp
data.  This is caused by EGCS optimizer bug.
>How-To-Repeat:
# ping -s 57 localhost
>Fix:
Compiled with -O0 or apply following patch
Index: ping.c
===================================================================
RCS file: /usr/home/ncvs/src/sbin/ping/ping.c,v
retrieving revision 1.44
diff -c -r1.44 ping.c
*** ping.c      1999/05/07 14:38:48     1.44
--- ping.c      1999/08/21 15:55:39
***************
*** 944,949 ****
--- 944,950 ----
        /* mop up an odd byte, if necessary */
        if (nleft == 1) {
                *(u_char *)(&answer) = *(u_char *)w ;
+               *((u_char *)(&answer) + 1) = 0;
                sum += answer;
        }
  


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: pb 
State-Changed-When: Mon Nov 15 12:06:03 PST 1999 
State-Changed-Why:  
Fixed in -current (with a different patch). Thanks! 
>Unformatted:
