Skip to content

Commit 9611a7a

Browse files
committed
Add changes
1 parent 0e5df64 commit 9611a7a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

shared-bindings/socketpool/SocketPool.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ MP_DEFINE_EXCEPTION(gaierror, OSError)
9393
//|
9494
//| :param ~int family: AF_INET or AF_INET6
9595
//| :param ~int type: SOCK_STREAM, SOCK_DGRAM or SOCK_RAW
96-
//| :param ~int proto: Int
96+
//| :param ~int proto: IPPROTO_TCP or IPPROTO_IP. Only works with SOCK_RAW
9797
//|
9898
//| The ``fileno`` argument available in ``socket.socket()``
9999
//| in CPython is not supported.
@@ -114,6 +114,8 @@ STATIC mp_obj_t socketpool_socketpool_socket(size_t n_args, const mp_obj_t *pos_
114114
socketpool_socketpool_addressfamily_t family = args[ARG_family].u_int;
115115
socketpool_socketpool_sock_t type = args[ARG_type].u_int;
116116
int proto = args[ARG_proto].u_int;
117+
118+
if (proto < 0) {proto = 0;}
117119

118120
return common_hal_socketpool_socket(self, family, type, proto);
119121
}

0 commit comments

Comments
 (0)