From 3e9c0230f45cafb9154bb4fcdc8ff2b51f00701a Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Tue, 22 Nov 2016 16:10:06 -0500 Subject: url: Fix conn reuse for local ports and interfaces - Fix connection reuse for when the proposed new conn 'needle' has a specified local port but does not have a specified device interface. Bug: https://curl.haxx.se/mail/lib-2016-11/0137.html Reported-by: bjt3[at]hotmail.com --- lib/url.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/url.c b/lib/url.c index 7106d46d4..552be9468 100644 --- a/lib/url.c +++ b/lib/url.c @@ -3400,9 +3400,8 @@ ConnectionExists(struct Curl_easy *data, */ if((check->localport != needle->localport) || (check->localportrange != needle->localportrange) || - !check->localdev || - !needle->localdev || - strcmp(check->localdev, needle->localdev)) + (needle->localdev && + (!check->localdev || strcmp(check->localdev, needle->localdev)))) continue; } -- cgit v1.2.3