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

Submitter:  Harsha Rajendran <hrajendran>
Submitted:  Mon 18 May 2015 01:38:28 PM UTC
   
 
Category:  sockets/netconn Severity:  3 - Normal
Item Group:  Faulty Behaviour Status:  Duplicate
Privacy:  Public Assigned to:  None
Open/Closed:  Closed Planned 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>

 

(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

 

Carbon-Copy List
  • -email is unavailable- added by gradator (Updated the item)
  • -email is unavailable- added by deft (Posted a comment)
  • -email is unavailable- added by hrajendran (Submitted the item)
  •  

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2015-05-18 gradator StatusNone Duplicate
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code