Deleted Added
full compact
clnt_rc.c (195703) clnt_rc.c (196503)
1/*-
2 * Copyright (c) 2008 Isilon Inc http://www.isilon.com/
3 * Authors: Doug Rabson <dfr@rabson.org>
4 * Developed with Red Inc: Alfred Perlstein <alfred@freebsd.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2008 Isilon Inc http://www.isilon.com/
3 * Authors: Doug Rabson <dfr@rabson.org>
4 * Developed with Red Inc: Alfred Perlstein <alfred@freebsd.org>
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 12 unchanged lines hidden (view full) ---

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/rpc/clnt_rc.c 195703 2009-07-14 22:54:29Z kib $");
29__FBSDID("$FreeBSD: head/sys/rpc/clnt_rc.c 196503 2009-08-24 10:09:30Z zec $");
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/limits.h>
35#include <sys/lock.h>
36#include <sys/malloc.h>
37#include <sys/mbuf.h>

--- 132 unchanged lines hidden (view full) ---

170 * My turn to attempt a connect. The rc_connecting variable
171 * serializes the following code sequence, so it is guaranteed
172 * that rc_client will still be NULL after it is re-locked below,
173 * since that is the only place it is set non-NULL.
174 */
175 rc->rc_connecting = TRUE;
176 mtx_unlock(&rc->rc_lock);
177
30
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/kernel.h>
34#include <sys/limits.h>
35#include <sys/lock.h>
36#include <sys/malloc.h>
37#include <sys/mbuf.h>

--- 132 unchanged lines hidden (view full) ---

170 * My turn to attempt a connect. The rc_connecting variable
171 * serializes the following code sequence, so it is guaranteed
172 * that rc_client will still be NULL after it is re-locked below,
173 * since that is the only place it is set non-NULL.
174 */
175 rc->rc_connecting = TRUE;
176 mtx_unlock(&rc->rc_lock);
177
178 oldcred = td->td_ucred;
179 td->td_ucred = rc->rc_ucred;
178 so = __rpc_nconf2socket(rc->rc_nconf);
179 if (!so) {
180 stat = rpc_createerr.cf_stat = RPC_TLIERROR;
181 rpc_createerr.cf_error.re_errno = 0;
180 so = __rpc_nconf2socket(rc->rc_nconf);
181 if (!so) {
182 stat = rpc_createerr.cf_stat = RPC_TLIERROR;
183 rpc_createerr.cf_error.re_errno = 0;
184 td->td_ucred = oldcred;
182 goto out;
183 }
184
185 goto out;
186 }
187
185 oldcred = td->td_ucred;
186 td->td_ucred = rc->rc_ucred;
187 if (rc->rc_privport)
188 bindresvport(so, NULL);
189
190 if (rc->rc_nconf->nc_semantics == NC_TPI_CLTS)
191 newclient = clnt_dg_create(so,
192 (struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers,
193 rc->rc_sendsz, rc->rc_recvsz);
194 else

--- 317 unchanged lines hidden ---
188 if (rc->rc_privport)
189 bindresvport(so, NULL);
190
191 if (rc->rc_nconf->nc_semantics == NC_TPI_CLTS)
192 newclient = clnt_dg_create(so,
193 (struct sockaddr *) &rc->rc_addr, rc->rc_prog, rc->rc_vers,
194 rc->rc_sendsz, rc->rc_recvsz);
195 else

--- 317 unchanged lines hidden ---