From c9d6628503ef49fdc2e537f96c78c2d3174a0fe7 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Mon, 24 Jan 2000 02:24:22 +0000 Subject: in bindresvport(), if sin is non-NULL, example sin->sin_family for the actual family being processed --- lib/libc/rpc/bindresvport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/libc/rpc/bindresvport.c b/lib/libc/rpc/bindresvport.c index d30ef7b4d3b..37789e9d786 100644 --- a/lib/libc/rpc/bindresvport.c +++ b/lib/libc/rpc/bindresvport.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: bindresvport.c,v 1.11 1999/12/17 19:22:08 deraadt Exp $"; +static char *rcsid = "$OpenBSD: bindresvport.c,v 1.12 2000/01/24 02:24:21 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ /* @@ -51,7 +51,9 @@ bindresvport(sd, sin) int sd; struct sockaddr_in *sin; { - return bindresvport_af(sd, (struct sockaddr *)sin, AF_INET); + if (sin) + return bindresvport_af(sd, (struct sockaddr *)sin, sin->sin_family); + return bindresvport_af(sd, NULL, AF_INET); } /* -- cgit v1.2.3