Deleted Added
sdiff udiff text old ( 184588 ) new ( 196503 )
full compact
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 $");
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 <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) {
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);
832 if (error)
833 goto out;
834
835 opt.sopt_dir = SOPT_SET;
836 opt.sopt_val = &portlow;
837 error = sosetopt(so, &opt);
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;
848 sosetopt(so, &opt);
849 }
850 }
851out:
852 if (freesa)
853 free(sa, M_SONAME);
854
855 return (error);
856}

--- 19 unchanged lines hidden ---