svc_generic.c (194407) | svc_generic.c (196503) |
---|---|
1/* $NetBSD: svc_generic.c,v 1.3 2000/07/06 03:10:35 christos Exp $ */ 2 3/* 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 5 * unrestricted use provided that this legend is included on all tape 6 * media and as a part of the software program in whole or part. Users 7 * may copy or modify Sun RPC without charge, but are not authorized 8 * to license or distribute it to anyone else except as part of a product or --- 24 unchanged lines hidden (view full) --- 33 * Copyright (c) 1986-1991 by Sun Microsystems Inc. 34 */ 35 36#if defined(LIBC_SCCS) && !defined(lint) 37#ident "@(#)svc_generic.c 1.19 94/04/24 SMI" 38static char sccsid[] = "@(#)svc_generic.c 1.21 89/02/28 Copyr 1988 Sun Micro"; 39#endif 40#include <sys/cdefs.h> | 1/* $NetBSD: svc_generic.c,v 1.3 2000/07/06 03:10:35 christos Exp $ */ 2 3/* 4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 5 * unrestricted use provided that this legend is included on all tape 6 * media and as a part of the software program in whole or part. Users 7 * may copy or modify Sun RPC without charge, but are not authorized 8 * to license or distribute it to anyone else except as part of a product or --- 24 unchanged lines hidden (view full) --- 33 * Copyright (c) 1986-1991 by Sun Microsystems Inc. 34 */ 35 36#if defined(LIBC_SCCS) && !defined(lint) 37#ident "@(#)svc_generic.c 1.19 94/04/24 SMI" 38static char sccsid[] = "@(#)svc_generic.c 1.21 89/02/28 Copyr 1988 Sun Micro"; 39#endif 40#include <sys/cdefs.h> |
41__FBSDID("$FreeBSD: head/sys/rpc/svc_generic.c 194407 2009-06-17 22:50:26Z rmacklem $"); | 41__FBSDID("$FreeBSD: head/sys/rpc/svc_generic.c 196503 2009-08-24 10:09:30Z zec $"); |
42 43/* 44 * svc_generic.c, Server side for RPC. 45 * 46 */ 47 48#include "opt_inet6.h" 49 --- 5 unchanged lines hidden (view full) --- 55#include <sys/protosw.h> 56#include <sys/queue.h> 57#include <sys/socket.h> 58#include <sys/socketvar.h> 59#include <sys/systm.h> 60#include <sys/sx.h> 61#include <sys/ucred.h> 62 | 42 43/* 44 * svc_generic.c, Server side for RPC. 45 * 46 */ 47 48#include "opt_inet6.h" 49 --- 5 unchanged lines hidden (view full) --- 55#include <sys/protosw.h> 56#include <sys/queue.h> 57#include <sys/socket.h> 58#include <sys/socketvar.h> 59#include <sys/systm.h> 60#include <sys/sx.h> 61#include <sys/ucred.h> 62 |
63#include <net/vnet.h> 64 |
|
63#include <rpc/rpc.h> 64#include <rpc/rpcb_clnt.h> 65#include <rpc/nettype.h> 66 67#include <rpc/rpc_com.h> 68 69extern int __svc_vc_setflag(SVCXPRT *, int); 70 --- 152 unchanged lines hidden (view full) --- 223 return (NULL); 224 } 225 __rpc_nconf2sockinfo(nconf, &si); 226 madeso = TRUE; 227 } else { 228 /* 229 * It is an open socket. Get the transport info. 230 */ | 65#include <rpc/rpc.h> 66#include <rpc/rpcb_clnt.h> 67#include <rpc/nettype.h> 68 69#include <rpc/rpc_com.h> 70 71extern int __svc_vc_setflag(SVCXPRT *, int); 72 --- 152 unchanged lines hidden (view full) --- 225 return (NULL); 226 } 227 __rpc_nconf2sockinfo(nconf, &si); 228 madeso = TRUE; 229 } else { 230 /* 231 * It is an open socket. Get the transport info. 232 */ |
233 CURVNET_SET(so->so_vnet); |
|
231 if (!__rpc_socket2sockinfo(so, &si)) { 232 printf( 233 "svc_tli_create: could not get transport information\n"); | 234 if (!__rpc_socket2sockinfo(so, &si)) { 235 printf( 236 "svc_tli_create: could not get transport information\n"); |
237 CURVNET_RESTORE(); |
|
234 return (NULL); 235 } | 238 return (NULL); 239 } |
240 CURVNET_RESTORE(); |
|
236 } 237 238 /* 239 * If the socket is unbound, try to bind it. 240 */ 241 if (madeso || !__rpc_sockisbound(so)) { 242 if (bindaddr == NULL) { 243 if (bindresvport(so, NULL)) { --- 10 unchanged lines hidden (view full) --- 254 solisten(so, SOMAXCONN, curthread); 255 } else { 256 if (bindresvport(so, 257 (struct sockaddr *)bindaddr->addr.buf)) { 258 printf( 259 "svc_tli_create: could not bind to requested address\n"); 260 goto freedata; 261 } | 241 } 242 243 /* 244 * If the socket is unbound, try to bind it. 245 */ 246 if (madeso || !__rpc_sockisbound(so)) { 247 if (bindaddr == NULL) { 248 if (bindresvport(so, NULL)) { --- 10 unchanged lines hidden (view full) --- 259 solisten(so, SOMAXCONN, curthread); 260 } else { 261 if (bindresvport(so, 262 (struct sockaddr *)bindaddr->addr.buf)) { 263 printf( 264 "svc_tli_create: could not bind to requested address\n"); 265 goto freedata; 266 } |
267 CURVNET_SET(so->so_vnet); |
|
262 solisten(so, (int)bindaddr->qlen, curthread); | 268 solisten(so, (int)bindaddr->qlen, curthread); |
269 CURVNET_RESTORE(); |
|
263 } 264 265 } 266 /* 267 * call transport specific function. 268 */ 269 switch (si.si_socktype) { 270 case SOCK_STREAM: --- 51 unchanged lines hidden --- | 270 } 271 272 } 273 /* 274 * call transport specific function. 275 */ 276 switch (si.si_socktype) { 277 case SOCK_STREAM: --- 51 unchanged lines hidden --- |