hitstergtd / openpgm

Automatically exported from code.google.com/p/openpgm
0 stars 0 forks source link

when I do pgm_bind3 to a sockaddr that has the sockaddr->sa_addr.sport set, openpgm reverses the byte order of that value #23

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. call pgm_bind3 with a sockaddr that has sockaddr->sa_addr.sport set to a 
value
2. in socket.c line 2029, it calls htons on that port value, thus reversing it. 
The sport in a sockaddr should already be assumed to be in network byte order

What is the expected output? What do you see instead?
I expect the tsi to use the port value I specified

What version of the product are you using? On what operating system?
linux/windows, openpgm 5.1.118

Please provide any additional information below.
change socket.c line 2029 from:
    sock->tsi.sport = htons (sock->tsi.sport);
to 
    sock->tsi.sport = sock->tsi.sport;

Original issue reported on code.google.com by chaimmi...@gmail.com on 17 Aug 2012 at 12:13

GoogleCodeExporter commented 8 years ago
It was 50-50 whether to use network order or not as the legacy APIs with 
pgm_tsi_t would not be obvious to use it:

http://code.google.com/p/openpgm/wiki/OpenPgm2CReferencePgmTsiT

Original comment by fnjo...@gmail.com on 18 Aug 2012 at 1:24