Hard-coded EADDRINUSE is platform-specific

Bug #1793540 reported by Todd Sankey
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
py3dns
Fix Released
Medium
Scott Kitterman

Bug Description

Base.py has a method named "getSource" which is used to randomize the source port value. The method detects transient race conditions by detecting EADDRINUSE but it uses a hard-coded value of 98, rather than the symbolic constant of errno.EADDRINUSE. 98 only works on Linux. BSDs and Windows have a different value. As a result, on these platforms the DNS request will fail when this race condition hits, rather than the library trying another source port number.

Changed in py3dns:
status: New → In Progress
importance: Undecided → Medium
assignee: nobody → Scott Kitterman (kitterman)
milestone: none → 3.2.1
Changed in py3dns:
status: In Progress → Fix Committed
Revision history for this message
Scott Kitterman (kitterman) wrote :

3.2.1 Wed, Sep 4, 2019
 * Add support for setting timeout for convenience methods in DNS.lazy
 * Fixed DNS.req resulttype error format (LP: #1842423)
 * Use errno.EADDRINUSE instead of the hard coded Linux value for improved
   portability (LP: #1793540)
 * Update test suite to correct for use of no longer existing DNS records
 * Set timeout=1 for tests so testing with a non-responsive nameserver will
   finish in a reasonable time

Changed in py3dns:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.