shithub: plan9front

Download patch

ref: 2ca5abbc2b1d1c29ec47bd317244603db16f6bf3
parent: 25a0d57478500aed9669e0492583523665afd49d
author: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
date: Sat Jun 11 08:34:31 EDT 2022

ape/bsd/bind.c: Do not pretend that the port could be negative.

Ports are filtered through "htons" which returns an "unsigned short".

--- a/sys/src/ape/lib/bsd/bind.c	Fri Jun 10 16:39:28 2022
+++ b/sys/src/ape/lib/bsd/bind.c	Sat Jun 11 08:34:31 2022
@@ -68,7 +68,7 @@
 
 	close(cfd);
 
-	if(_sock_inport(&r->addr) <= 0)
+	if(_sock_inport(&r->addr) == 0)
 		_sock_ingetaddr(r, &r->addr, 0, "local");
 
 	return 0;