File tree Expand file tree Collapse file tree
pingora-core/src/listeners Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -193,13 +193,22 @@ fn apply_tcp_socket_options(sock: &TcpSocket, opt: Option<&TcpSocketOptions>) ->
193193 . or_err ( BindError , "failed to set IPV6_V6ONLY" ) ?;
194194 }
195195
196- #[ cfg( unix) ]
196+ #[ cfg( all ( unix, not ( any ( target_os = "illumos" , target_os = "solaris" ) ) ) ) ]
197197 if let Some ( reuseport) = opt. so_reuseport {
198198 socket_ref
199199 . set_reuse_port ( reuseport)
200200 . or_err ( BindError , "failed to set SO_REUSEPORT" ) ?;
201201 }
202202
203+ // illumos and Solaris have no SO_REUSEPORT; refuse rather than ignore the request.
204+ #[ cfg( any( target_os = "illumos" , target_os = "solaris" ) ) ]
205+ if opt. so_reuseport . is_some ( ) {
206+ return pingora_error:: Error :: e_explain (
207+ BindError ,
208+ "SO_REUSEPORT is not supported on this platform" ,
209+ ) ;
210+ }
211+
203212 #[ cfg( unix) ]
204213 let raw = sock. as_raw_fd ( ) ;
205214 #[ cfg( windows) ]
You can’t perform that action at this time.
0 commit comments