mirror of https://github.com/ipxe/ipxe.git
Add sanity check and extra debug message
parent
63719deea9
commit
3acd51597a
|
@ -277,6 +277,7 @@ static void tcp_close ( struct tcp_connection *tcp, int rc ) {
|
||||||
stop_timer ( &tcp->timer );
|
stop_timer ( &tcp->timer );
|
||||||
list_del ( &tcp->list );
|
list_del ( &tcp->list );
|
||||||
ref_put ( &tcp->refcnt );
|
ref_put ( &tcp->refcnt );
|
||||||
|
DBGC ( tcp, "TCP %p connection deleted\n", tcp );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -980,6 +981,10 @@ struct socket_opener tcp_socket_opener __socket_opener = {
|
||||||
static int tcp_open_uri ( struct xfer_interface *xfer, struct uri *uri ) {
|
static int tcp_open_uri ( struct xfer_interface *xfer, struct uri *uri ) {
|
||||||
struct sockaddr_tcpip peer;
|
struct sockaddr_tcpip peer;
|
||||||
|
|
||||||
|
/* Sanity check */
|
||||||
|
if ( ! uri->host )
|
||||||
|
return -EINVAL;
|
||||||
|
|
||||||
memset ( &peer, 0, sizeof ( peer ) );
|
memset ( &peer, 0, sizeof ( peer ) );
|
||||||
peer.st_port = htons ( uri_port ( uri, 0 ) );
|
peer.st_port = htons ( uri_port ( uri, 0 ) );
|
||||||
return xfer_open_named_socket ( xfer, SOCK_STREAM,
|
return xfer_open_named_socket ( xfer, SOCK_STREAM,
|
||||||
|
|
Loading…
Reference in New Issue