← Commit list

5d2b8670c6

Stefan Eissing
Stefan Eissing
2026-08-28
SUCCESS Duration: 395s

Subject

ipv6 scope_id: set from first peer

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/url.c+11 -5
@@ -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;
}