Bug 57259

Summary: tftp completely broken on non x86 architectures due to bad header file
Product: [Retired] Red Hat Raw Hide Reporter: Ralph Siemsen <ralphs>
Component: tftpAssignee: Elliot Lee <sopwith>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: high Docs Contact:
Priority: medium    
Version: 1.0   
Target Milestone: ---   
Target Release: ---   
Hardware: strongarm   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-12-07 23:34:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ralph Siemsen 2001-12-07 23:20:19 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.6) Gecko/20011120

Description of problem:
The 0.17 distribution of TFTP (currently available on RawHide) once again
includes its own copy of the <arpa/tftp.h> header file.  The structures
defined therein are transmitted over ethernet and therefore the compiler
must not add any additional padding to them.  This was reported and fixed
in RedHat 6.2 but the patch seems to have been lost.

Why do you need to supply your own headers anyways?  The system header,
which is part of glibc-devel, has the correct definitions in them. 
Building against that header file results in correct operation of the daemon.

As distributed the tftp service is totally broken on platforms like ARM
where the compiler will insert padding bytes in structures to align things
on 32-bit boundaries by default.

Version-Release number of selected component (if applicable):
tftp-0.17-14

How reproducible:
Always

Steps to Reproduce:
1. Build/install tftp-0.17 on ARM platform
2. Start the server via inetd/xinetd
3. Try to retrieve a file (for example)
tftp
> connect localhost
> get /boot/vmlinux


Actual Results:  An error message similar to:
The number varies randomly (its garbage data from uninitialized memory)

TFTP- Error 16283 - GAL operation


Expected Results:  The requested file should have been transferred.

Additional info:

This is easily fixed by removing the arpa/tftp.h header file included with
the package.

If that is not acceptible, then the struct tftphdr needs to be modified to
have __attribute__ ((__packed__)) right before the th_u member, and once
again after the closing brace of the same structure definition.  I can
provide a patch if this is not obvious.

Comment 1 Ralph Siemsen 2001-12-07 23:34:02 UTC
This might well affect current shipping versions of RH (7.x) as well - I haven't
checked.  It was working correctly in tfp-0.15-1.src.rpm, which dates back to
the early RedHat 6.x time if I'm not mistaken.


Comment 2 Elliot Lee 2001-12-18 21:31:33 UTC
I just removed the file...