rpc_generic.c (184588) | rpc_generic.c (196503) |
---|---|
1/* $NetBSD: rpc_generic.c,v 1.4 2000/09/28 09:07:04 kleink 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 --- 20 unchanged lines hidden (view full) --- 29 * Mountain View, California 94043 30 */ 31/* 32 * Copyright (c) 1986-1991 by Sun Microsystems Inc. 33 */ 34 35/* #pragma ident "@(#)rpc_generic.c 1.17 94/04/24 SMI" */ 36#include <sys/cdefs.h> | 1/* $NetBSD: rpc_generic.c,v 1.4 2000/09/28 09:07:04 kleink 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 --- 20 unchanged lines hidden (view full) --- 29 * Mountain View, California 94043 30 */ 31/* 32 * Copyright (c) 1986-1991 by Sun Microsystems Inc. 33 */ 34 35/* #pragma ident "@(#)rpc_generic.c 1.17 94/04/24 SMI" */ 36#include <sys/cdefs.h> |
37__FBSDID("$FreeBSD: head/sys/rpc/rpc_generic.c 184588 2008-11-03 10:38:00Z dfr $"); | 37__FBSDID("$FreeBSD: head/sys/rpc/rpc_generic.c 196503 2009-08-24 10:09:30Z zec $"); |
38 39/* 40 * rpc_generic.c, Miscl routines for RPC. 41 * 42 */ 43 44#include "opt_inet6.h" 45 --- 5 unchanged lines hidden (view full) --- 51#include <sys/proc.h> 52#include <sys/protosw.h> 53#include <sys/sbuf.h> 54#include <sys/systm.h> 55#include <sys/socket.h> 56#include <sys/socketvar.h> 57#include <sys/syslog.h> 58 | 38 39/* 40 * rpc_generic.c, Miscl routines for RPC. 41 * 42 */ 43 44#include "opt_inet6.h" 45 --- 5 unchanged lines hidden (view full) --- 51#include <sys/proc.h> 52#include <sys/protosw.h> 53#include <sys/sbuf.h> 54#include <sys/systm.h> 55#include <sys/socket.h> 56#include <sys/socketvar.h> 57#include <sys/syslog.h> 58 |
59#include <net/vnet.h> 60 |
|
59#include <rpc/rpc.h> 60#include <rpc/nettype.h> 61 62#include <rpc/rpc_com.h> 63 64#if __FreeBSD_version < 700000 65#define strrchr rindex 66#endif --- 750 unchanged lines hidden (view full) --- 817 default: 818 return (EPFNOSUPPORT); 819 } 820 821 sa->sa_family = af; 822 sa->sa_len = salen; 823 824 if (*portp == 0) { | 61#include <rpc/rpc.h> 62#include <rpc/nettype.h> 63 64#include <rpc/rpc_com.h> 65 66#if __FreeBSD_version < 700000 67#define strrchr rindex 68#endif --- 750 unchanged lines hidden (view full) --- 819 default: 820 return (EPFNOSUPPORT); 821 } 822 823 sa->sa_family = af; 824 sa->sa_len = salen; 825 826 if (*portp == 0) { |
827 CURVNET_SET(so->so_vnet); |
|
825 bzero(&opt, sizeof(opt)); 826 opt.sopt_dir = SOPT_GET; 827 opt.sopt_level = proto; 828 opt.sopt_name = portrange; 829 opt.sopt_val = &old; 830 opt.sopt_valsize = sizeof(old); 831 error = sogetopt(so, &opt); | 828 bzero(&opt, sizeof(opt)); 829 opt.sopt_dir = SOPT_GET; 830 opt.sopt_level = proto; 831 opt.sopt_name = portrange; 832 opt.sopt_val = &old; 833 opt.sopt_valsize = sizeof(old); 834 error = sogetopt(so, &opt); |
832 if (error) | 835 if (error) { 836 CURVNET_RESTORE(); |
833 goto out; | 837 goto out; |
838 } |
|
834 835 opt.sopt_dir = SOPT_SET; 836 opt.sopt_val = &portlow; 837 error = sosetopt(so, &opt); | 839 840 opt.sopt_dir = SOPT_SET; 841 opt.sopt_val = &portlow; 842 error = sosetopt(so, &opt); |
843 CURVNET_RESTORE(); |
|
838 if (error) 839 goto out; 840 } 841 842 error = sobind(so, sa, curthread); 843 844 if (*portp == 0) { 845 if (error) { 846 opt.sopt_dir = SOPT_SET; 847 opt.sopt_val = &old; | 844 if (error) 845 goto out; 846 } 847 848 error = sobind(so, sa, curthread); 849 850 if (*portp == 0) { 851 if (error) { 852 opt.sopt_dir = SOPT_SET; 853 opt.sopt_val = &old; |
854 CURVNET_SET(so->so_vnet); |
|
848 sosetopt(so, &opt); | 855 sosetopt(so, &opt); |
856 CURVNET_RESTORE(); |
|
849 } 850 } 851out: 852 if (freesa) 853 free(sa, M_SONAME); 854 855 return (error); 856} --- 19 unchanged lines hidden --- | 857 } 858 } 859out: 860 if (freesa) 861 free(sa, M_SONAME); 862 863 return (error); 864} --- 19 unchanged lines hidden --- |