buglwIP - A Lightweight TCP/IP stack - Bugs: bug #8864, inet_ntoa doesn't convert string...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #8864: inet_ntoa doesn't convert string correctly

Submitter:  Shawn He <bluesea>
Submitted:  Mon 10 May 2004 06:20:12 PM UTC
   
 
Category:  IPv4 Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Fixed
Privacy:  Public Assigned to:  jani
Open/Closed:  Closed Planned Release:  None
lwIP version:  None

Wed 01 Dec 2004 06:30:56 PM UTC, comment #4: 

Looks like this has already been fixed in 1.0.0 - the ap variable is already a u8_t, which should map to unsigned char on most architectures.

Kieran Mansley <kieranm>
Group Member
Wed 01 Dec 2004 05:10:59 PM UTC, comment #3: 

I have seen and fixed this bug. The reason you can't reproduce it is probably due to the choice of IP Address and compiler.

It all depends what type your compiler defaults a char type to, that's ambiguous and a good argument for some people no doubt. In the case of our Nios compuiler it defaults to signed char. This means that the code in inet_ntoa inside the do while loop can have a -ve value and produce the wrong results. Making ap an unsigned char* fixes this.

Apologies for not submitting a patch as my changes are quite significant for our architecture. Though I will merge those in once 1.1.0 is released.

Paul RIley <priley>
Wed 26 May 2004 04:39:29 PM UTC, comment #2: 

This occurs on PS2 platform, after I change char *ap back to u8_t *ap, then it works fine again. That's all I can say about this bug, I never tested on other platforms. -Shawn He

Shawn He <bluesea>
Wed 26 May 2004 10:40:41 AM UTC, comment #1: 

Appears to work OK, awaiting test case from the original bug submitter.

Kieran Mansley <kieranm>
Group Member
Mon 10 May 2004 06:20:12 PM UTC, original submission:  

When inet_ntoa converts an ip address s_addr=0xD01E050A inside function to a string, the returning string str will be 10.5.30.,( instead of 10.5.30.208.

Shawn He <bluesea>

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 4 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-12-01 kieranm StatusWorks For Me Fixed
    Open/ClosedOpen Closed
2004-05-26 kieranm StatusNone Works For Me
2004-05-26 kieranm Assigned toNone jani

Back to the top

Powered by Savane 3.13-f8d8.
Corresponding source code