613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * CDDL HEADER START
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * The contents of this file are subject to the terms of the
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Common Development and Distribution License (the "License").
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * You may not use this file except in compliance with the License.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * See the License for the specific language governing permissions
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * and limitations under the License.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * When distributing Covered Code, include this CDDL HEADER in each
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * If applicable, add the following below this CDDL HEADER, with the
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * fields enclosed by brackets "[]" replaced with your own identifying
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * information: Portions Copyright [yyyy] [name of copyright owner]
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * CDDL HEADER END
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Use is subject to license terms.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Create a new VC given a list of addresses.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Ask the IOD to create a VC with this IP address.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Copy the passed address into ssn_srvaddr,
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * but first sanity-check lengths. Also,
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * zero it first to avoid trailing junk.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross bzero(&ssn->ssn_srvaddr, sizeof (ssn->ssn_srvaddr));
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross bcopy(ai->ai_addr, &ssn->ssn_srvaddr, ai->ai_addrlen);
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross * Setup a new VC via the IOD.
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross /* Should already have the address list. */
6b2bcd8e40cb530c97e59f351ceccb5c807ac34aGordon Ross * Get a door handle to the smbiod if we
6b2bcd8e40cb530c97e59f351ceccb5c807ac34aGordon Ross * don't have one already. This also
6b2bcd8e40cb530c97e59f351ceccb5c807ac34aGordon Ross * starts the smbiod if necessary.
6b2bcd8e40cb530c97e59f351ceccb5c807ac34aGordon Ross err = EPROTONOSUPPORT; /* in case no AF match */
613a2f6ba31e891e3d947a356daf5e563d43c1ceGordon Ross for (ai = ctx->ct_addrinfo; ai; ai = ai->ai_next) {
6b2bcd8e40cb530c97e59f351ceccb5c807ac34aGordon Ross * In the error case, the caller may try again
6b2bcd8e40cb530c97e59f351ceccb5c807ac34aGordon Ross * with new auth. info, so keep the door open.
6b2bcd8e40cb530c97e59f351ceccb5c807ac34aGordon Ross * Error return will close in smb_ctx_done.
6b2bcd8e40cb530c97e59f351ceccb5c807ac34aGordon Ross /* Done with the door handle. */