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

Submitted by:  Shawn He <bluesea>
Submitted on:  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 Monoses <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>
Project 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>
Project 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>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

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

Only logged-in users can vote.

 

 

 

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.5