patchlwIP - A Lightweight TCP/IP stack - Patches: patch #8480, Fix handling of dns_seqno...

 
 

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

patch #8480: Fix handling of dns_seqno wraparound

Submitter:  Kevin Cernekee <cernekee>
Submitted:  Sat 14 Jun 2014 10:29:40 PM UTC
   
 
Category:  DNS Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  goldsimon Open/Closed:  Closed
Planned Release:  None

Wed 17 Sep 2014 08:53:26 PM UTC, comment #1: 

Fixed, thanks for reporting.

Simon Goldschmidt <goldsimon>
Group administrator
Sat 14 Jun 2014 10:29:40 PM UTC, original submission:  

In dns_enqueue(), lseq represents the number of DNS transactions that have occurred since dns_table[lseqi] was started.  This should be a positive number.  But gcc promotes (dns_seqno - pEntry->seqno) to a signed int, causing lseq to be compared against negative values in some situations:

  dns_seqno = 1
  dns_table[0].seqno =   0, state = DNS_STATE_ASKING
  dns_table[1].seqno = 253, state = DNS_STATE_DONE
  dns_table[2].seqno = 254, state = DNS_STATE_DONE
  dns_table[3].seqno = 255, state = DNS_STATE_DONE

In this case, lseqi == 0 and the function returns ERR_MEM, despite the fact that entries 1..3 are available for reuse.

Fix this by explicitly casting the "age" result to a u8_t.

Kevin Cernekee <cernekee>

 

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

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by cernekee (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 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2014-09-17 goldsimon StatusNone Done
        Assigned toNone goldsimon
        Open/ClosedOpen Closed
    2014-06-14 cernekee Attached File- Added 0001-dns-Fix-handling-of-dns_seqno-wraparound.patch, #31547

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code