Bug 3173 - RedHat 6.0 - network not working on Alpha
RedHat 6.0 - network not working on Alpha
Status: CLOSED DUPLICATE of bug 1786
Product: Red Hat Linux
Classification: Retired
Component: netkit-base (Show other bugs)
6.0
alpha Linux
high Severity high
: ---
: ---
Assigned To: Jay Turner
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-05-31 04:56 EDT by folke
Modified: 2015-01-07 18:37 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-05-31 11:19:22 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description folke 1999-05-31 04:56:07 EDT
1. Broken ping: see comp.os.linux.alpha - 8 bit error
2. Ethernet does not work - works fine with redhat 5.2!

1.
Subject: PATCH: broken ping on RH 6.0
Date: Fri, 14 May 1999 17:41:46 +0200
From: Alex Rhomberg <rhomberg@ife.ee.ethz.ch>
Organization: Electronics Lab, ETH Zurich, Switzerland
Newsgroups: comp.os.linux.alpha

ping in netkit 0.11+ assumes that timeval has a length of
eight bytes
and works with 32 bit alignment. This is no longer the case
on my Alphas
running Linux 2.2.5 and Redhat 6.0 (might be due to glibc
2.1??)
Ping generated unaligned traps and erroneously reported
receiving of
wrong data.
This is fixed by the following patch. Note that I did not
read the whole
code but just made some wild guesses. The unaligned traps
and the wrong
data errors are gone.

Regards
- Alex

--- ping.unpatched.c    Fri May 14 17:30:50 1999
+++ ping.c      Fri May 14 17:31:06 1999
@@ -394,7 +394,7 @@
                exit(2);
        }
        if (!(options & F_PINGFILLED))
-               for (i = 8; i < datalen; ++i)
+               for (i = sizeof(struct timeval); i <
datalen; ++i)
                        *datap++ = i;

        ident = getpid() & 0xFFFF;
@@ -657,11 +657,18 @@
                        return;                 /* 'Twas not
our ECHO */
                ++nreceived;
                if (timing) {
+                 struct timeval temp_tv;
 #ifndef icmp_data
                        tp = (struct timeval *)(icp + 1);
 #else
                        tp = (struct timeval
*)icp->icmp_data;
 #endif
+                       if((long)tp % sizeof(tp->tv_sec))
+                       {
+                         char *unaligned_pointer = (char
*)tp;
+                         tp = &temp_tv;
+                         memcpy(tp, unaligned_pointer,
sizeof(struct
timeval));
+                       }
                        tvsub(&tv, tp);
                        triptime = tv.tv_sec * 10000 +
(tv.tv_usec /
100);
                        tsum += triptime;
@@ -697,9 +704,9 @@
                                (void)printf(" (DUP!)");
                        /* check the data */
 #ifndef icmp_data
-                       cp = ((u_char*)(icp + 1) + 8);
+                       cp = ((u_char*)(icp + 1) +
sizeof(struct
timeval));
 #else
-                       cp = (u_char*)icp->icmp_data + 8;
+                       cp = (u_char*)icp->icmp_data +
sizeof(struct
timeval);
 #endif
                        dp = &outpack[8 + sizeof(struct
timeval)];
                        for (i = 8; i < datalen; ++i, ++cp,
++dp) {

--

____________________________________________________________
_____
 /
       \
|  Alex Rhomberg                           Tel: +41 1 632 49
18     |
|  Institut fuer Elektronik                Fax: +41 1 632 12
10     |
|  ETH Zuerich                        Zentrale: +41 1 632 11
11     |
|  Gloriastrasse 35
        |
|  8092 Zuerich               email: rhomberg@ife.ee.ethz.ch
       |

\___________________________________________________________
______/
Comment 1 Jeff Johnson 1999-05-31 11:19:59 EDT
1) The broken ping on alpha has been fixed.
2) Dunno about "Ethernet does not work" -- more information is needed.1) The broken ping on alpha has been fixed.
2) Dunno about "Ethernet does not work" -- more information is needed.

*** This bug has been marked as a duplicate of 1786 ***

------- Email Received From  Christian Folke <folke@tee.uni-essen.de> 06/01/99 06:10 -------

Note You need to log in before you can comment on or make changes to this bug.