ipv6 scope_id: set from first peer
No binary (build failed)
—
(log yok)
| @@ -1576,11 +1576,6 @@ static CURLcode url_set_conn_origin_etc(struct Curl_easy *data, | |
| } | |
| } | |
| - | #ifdef USE_IPV6 |
| - | conn->scope_id = data->set.scope_id ? |
| - | data->set.scope_id : data->state.origin->scopeid; |
| - | #endif |
| - | |
| out: | |
| return result; | |
| } | |
| @@ -1659,6 +1654,17 @@ static CURLcode setup_connection_internals(struct Curl_easy *data, | |
| Curl_strntolower(conn->destination, conn->destination, | |
| strlen(conn->destination)); | |
| + | #ifdef USE_IPV6 |
| + | if(data->set.scope_id) |
| + | conn->scope_id = data->set.scope_id; |
| + | else { |
| + | struct Curl_peer *first = Curl_conn_get_first_peer(conn, FIRSTSOCKET); |
| + | if(!first) |
| + | return CURLE_FAILED_INIT; |
| + | conn->scope_id = first->scopeid; |
| + | } |
| + | #endif |
| + | |
| return CURLE_OK; | |
| } | |