buglwIP - A Lightweight TCP/IP stack - Bugs: bug #45130, "tv_sec" element of the...

 
 

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

bug #45130: "tv_sec" element of the timeval struct used in setsockopt should in fact be milliseconds and not seconds

Submitted by:  Harsha Rajendran <hrajendran>
Submitted on:  Mon 18 May 2015 01:38:28 PM UTC  
 
Category: sockets/netconnSeverity: 3 - Normal
Item Group: Faulty BehaviourStatus: Duplicate
Privacy: PublicAssigned to: None
Open/Closed: ClosedPlanned Release: None
lwIP version: 1.4.1

Mon 18 May 2015 06:19:00 PM UTC, comment #4:

Will do. Thank you, sir!

Harsha Rajendran <hrajendran>
Mon 18 May 2015 06:07:27 PM UTC, comment #3:

Well, as I understand it, 1.4.1 didn't handle a timeval struct but instead just dereferenced the void* optval into an integer and used it as milliseconds. If you pass a timeval there you'd (most likely) get the tv_sec field.

On git head you can check the LWIP_SO_SNDRCVTIMEO_GET_MS macro in sockets.c which converts a struct timeval to milliseconds.

Jens Nielsen <deft>
Mon 18 May 2015 05:50:54 PM UTC, comment #2:

Bug #43797 seems to have an entirely different bug description from mine. Could you perhaps direct me to the fixes, then? The latest release doesn't seem to have it. Therefore, I am assuming the "head" has the updates.

Harsha Rajendran <hrajendran>
Mon 18 May 2015 05:19:52 PM UTC, comment #1:

This is already fixed in bug #43797, right?

Jens Nielsen <deft>
Mon 18 May 2015 01:38:28 PM UTC, original submission:

The timeval struct which is passed to setsockopt has two fields, tv_sec and tv_usec. However, on closer examination of the code, I found that tv_sec was being treated as milliseconds and not seconds, like it is mentioned. Either the struct should be modified to reflect this change, or the time expiration logic must be changed.

Thanks
Harsha

Harsha Rajendran <hrajendran>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by gradator (Updated the item)
  • -unavailable- added by deft (Posted a comment)
  • -unavailable- added by hrajendran (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 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 18 May 2015 06:23:49 PM UTCgradatorStatusNone=>Duplicate
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1