bugTransport Sample Protocol - Bugs: bug #24797, Endian problem with ip adress ?

 
 

bug #24797: Endian problem with ip adress ?

Submitted by:  MARTINSONS <martinsons>
Submitted on:  Mon 10 Nov 2008 10:08:15 AM UTC  
 
Category: CoreSeverity: 3 - Normal
Status: Ready For TestPrivacy: Public
Assigned to: Eric NOULARD <erk>Open/Closed: Open
Release: 0.8.2Fixed Release: NextRelease

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 10 Nov 2008 02:37:45 PM UTC, comment #2:

Working on a patch.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Mon 10 Nov 2008 10:35:17 AM UTC, comment #1:

from tsp_stream_sender.c:330-331:

the "numeric" handling of hostname is somehow not so old:
https://savannah.nongnu.org/bugs/?14783
https://savannah.nongnu.org/bugs/?14770
so some use may not experience the bug because
they try to connect to the server with numeric @IP and
not with "hostname" (RTEMS case :-).

However you may be right ntohl seems to be the culprit.
We should ALWAYS use network byte order (and not host)
in order to build the appropriate string @IP address.
However, I have no big endian host at hand :=)

Would you be able to test and provide a patch for this?
It should concern both
tsp_stream_sender.c
tsp_server.c
and the companion "test prog"
src/util/libutil/tsp_check_host_and_ip.c

you may try to run
tsp_check_host_and_ip
on each host in order to check the appropriate way
to do it.

Eric NOULARD <erk>
Project AdministratorIn charge of this item.
Mon 10 Nov 2008 10:08:15 AM UTC, original submission:

Hello,

During my test between Linux (i686) and Solaris (Sparc V9), i noticed that there is no connection between the two machines.Apparently it will be an endianness problem because the tracks tells me that the server (on solaris) send a reversed IP to the consumer.I've changed the order for the byte in IP adress (tsp_server and tsp_stream_sender), in this function :

sprintf(host,
%d.%d.%d.%d,myu.parts[3],myu.parts[2],myu.parts[1],myu.parts[0]);

and it works well.I've read somethings for RTEMS where Yves tells he doubt there is an endian problem in TSP....

So endian problem or not ?

Fred.

MARTINSONS <martinsons>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Digest:
   patch dependencies.

 

Carbon-Copy List
  • -unavailable- added by erk (Posted a comment)
  • -unavailable- added by martinsons (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 5 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Wed 12 Nov 2008 12:32:56 PM UTCerkStatusIn Progress=>Ready For Test
      Fixed ReleaseUnknown=>NextRelease
    Mon 10 Nov 2008 02:37:44 PM UTCerkStatusNone=>In Progress
      Assigned toNone=>erk
      Fixed Release0.8.3=>Unknown

    Back to the top


    Powered by Savane 3.1-cleanup1