Closed
Bug 1372246
Opened 8 years ago
Closed 8 years ago
Fix the address size for bind in _PR_MD_TCPSENDTO and return error for GetOverlappedResult
Categories
(NSPR :: NSPR, enhancement)
NSPR
NSPR
Tracking
(Not tracked)
RESOLVED
FIXED
4.16
People
(Reporter: dragana, Assigned: dragana)
References
Details
Attachments
(1 file)
3.38 KB,
patch
|
mcmanus
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Attachment #8876751 -
Flags: review?(mcmanus)
Assignee | ||
Comment 1•8 years ago
|
||
Assignee | ||
Comment 2•8 years ago
|
||
I do not think this cause crashes, but anyway need to be fixed.
Comment 3•8 years ago
|
||
(In reply to Dragana Damjanovic [:dragana] from comment #2)
> I do not think this cause crashes
:(
Comment 4•8 years ago
|
||
Comment on attachment 8876751 [details] [diff] [review]
bug_fixTFO_bind.patch
Review of attachment 8876751 [details] [diff] [review]:
-----------------------------------------------------------------
this makes sense to me - but kai is the new nspr owner..
Attachment #8876751 -
Flags: review?(mcmanus)
Attachment #8876751 -
Flags: review?(kaie)
Attachment #8876751 -
Flags: review+
Comment 5•8 years ago
|
||
Could you please briefly explain the motivation for this change? Might be helpful in the future if someone comes back here and wants to learn about the history.
Regarding the change of parameters for the bind call:
Changing the second parameter seems unnecessary, because bindAddr is a union, the old address of the variable should be the same as the address of the first member or the second member, right?
I assume the change to the third parameter was a major motivation for this patch, because PR_NETADDR_SIZE can apparently create a more complex result than a simple sizeof?
I don't know the lowlevel details of this code, so Patrick's r+ is enough.
Updated•8 years ago
|
Attachment #8876751 -
Flags: review?(kaie)
Assignee | ||
Comment 6•8 years ago
|
||
(In reply to Kai Engert (:kaie:) from comment #5)
> Could you please briefly explain the motivation for this change? Might be
> helpful in the future if someone comes back here and wants to learn about
> the history.
>
> Regarding the change of parameters for the bind call:
> Changing the second parameter seems unnecessary, because bindAddr is a
> union, the old address of the variable should be the same as the address of
> the first member or the second member, right?
>
> I assume the change to the third parameter was a major motivation for this
> patch, because PR_NETADDR_SIZE can apparently create a more complex result
> than a simple sizeof?
>
> I don't know the lowlevel details of this code, so Patrick's r+ is enough.
The bind parameters:
The change on the second parameter does not actually change anything. i made this change only to make this call similar to the other calls that have PRNetAddr as a parameter, just that.
The second change to bind: the address length was wrong, e.g. the address length of ipv4 is smaller than for ipv6. The windows bind function should do the right thing even if the length is wrong, it should check for address family and decide what data it needs. But to make this correct I have change the value.
I thought that GetOverlappedResult returns ERROR_IO_PENDING when ConnectEx has not finished yet, but it does not it return ERROR_IO_INCOMPLETE. In the Firefox case we use polling to check when socket is read, therefore I assume that we will never hit this error, but in case some uses a blocking socket or uses nspr in a different way it can hit this bug.
Comment 7•8 years ago
|
||
Thanks for the explanations. In which version of Firefox will you require this change? Will Firefox 56 be sufficiently early?
Assignee | ||
Comment 8•8 years ago
|
||
56 is just fine.
Thanks a lot!
Updated•8 years ago
|
Component: Libraries → NSPR
Product: NSS → NSPR
Version: trunk → other
Comment 9•8 years ago
|
||
https://hg.mozilla.org/projects/nspr/rev/24f9bb30f9f2
We need to change the target to 4.16 when bug 1370873 is fixed.
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Updated•8 years ago
|
Target Milestone: --- → 4.16
You need to log in
before you can comment on or make changes to this bug.
Description
•