equal
deleted
inserted
replaced
3126 ip_attr_newdst(ixa); |
3126 ip_attr_newdst(ixa); |
3127 |
3127 |
3128 /* Get a copy of conn_xmit_ipp since the options might change it */ |
3128 /* Get a copy of conn_xmit_ipp since the options might change it */ |
3129 ipp = kmem_zalloc(sizeof (*ipp), KM_NOSLEEP); |
3129 ipp = kmem_zalloc(sizeof (*ipp), KM_NOSLEEP); |
3130 if (ipp == NULL) { |
3130 if (ipp == NULL) { |
|
3131 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
|
3132 ixa->ixa_cpid = connp->conn_cpid; |
3131 ixa_refrele(ixa); |
3133 ixa_refrele(ixa); |
3132 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3134 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3133 freemsg(mp); |
3135 freemsg(mp); |
3134 return (ENOMEM); |
3136 return (ENOMEM); |
3135 } |
3137 } |
3355 connp->conn_v6lastdst = ipv6_all_zeros; |
3357 connp->conn_v6lastdst = ipv6_all_zeros; |
3356 mutex_exit(&connp->conn_lock); |
3358 mutex_exit(&connp->conn_lock); |
3357 break; |
3359 break; |
3358 } |
3360 } |
3359 done: |
3361 done: |
|
3362 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
|
3363 ixa->ixa_cpid = connp->conn_cpid; |
3360 ixa_refrele(ixa); |
3364 ixa_refrele(ixa); |
3361 ip_pkt_free(ipp); |
3365 ip_pkt_free(ipp); |
3362 kmem_free(ipp, sizeof (*ipp)); |
3366 kmem_free(ipp, sizeof (*ipp)); |
3363 return (error); |
3367 return (error); |
3364 } |
3368 } |
3395 connp->conn_fport, connp->conn_flowinfo, &error); |
3399 connp->conn_fport, connp->conn_flowinfo, &error); |
3396 |
3400 |
3397 if (mp == NULL) { |
3401 if (mp == NULL) { |
3398 ASSERT(error != 0); |
3402 ASSERT(error != 0); |
3399 mutex_exit(&connp->conn_lock); |
3403 mutex_exit(&connp->conn_lock); |
|
3404 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
|
3405 ixa->ixa_cpid = connp->conn_cpid; |
3400 ixa_refrele(ixa); |
3406 ixa_refrele(ixa); |
3401 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3407 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3402 freemsg(mp); |
3408 freemsg(mp); |
3403 return (error); |
3409 return (error); |
3404 } |
3410 } |
3450 break; |
3456 break; |
3451 } |
3457 } |
3452 /* FALLTHRU */ |
3458 /* FALLTHRU */ |
3453 default: |
3459 default: |
3454 failed: |
3460 failed: |
|
3461 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
|
3462 ixa->ixa_cpid = connp->conn_cpid; |
3455 ixa_refrele(ixa); |
3463 ixa_refrele(ixa); |
3456 freemsg(mp); |
3464 freemsg(mp); |
3457 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3465 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3458 return (error); |
3466 return (error); |
3459 } |
3467 } |
3481 * Don't have the application see that errno |
3489 * Don't have the application see that errno |
3482 */ |
3490 */ |
3483 error = ENETUNREACH; |
3491 error = ENETUNREACH; |
3484 break; |
3492 break; |
3485 } |
3493 } |
|
3494 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
|
3495 ixa->ixa_cpid = connp->conn_cpid; |
3486 ixa_refrele(ixa); |
3496 ixa_refrele(ixa); |
3487 return (error); |
3497 return (error); |
3488 } |
3498 } |
3489 |
3499 |
3490 /* |
3500 /* |
3512 connp->conn_lastdstport, connp->conn_lastflowinfo, &error); |
3522 connp->conn_lastdstport, connp->conn_lastflowinfo, &error); |
3513 |
3523 |
3514 if (mp == NULL) { |
3524 if (mp == NULL) { |
3515 ASSERT(error != 0); |
3525 ASSERT(error != 0); |
3516 mutex_exit(&connp->conn_lock); |
3526 mutex_exit(&connp->conn_lock); |
|
3527 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
|
3528 ixa->ixa_cpid = connp->conn_cpid; |
3517 ixa_refrele(ixa); |
3529 ixa_refrele(ixa); |
3518 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3530 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3519 freemsg(mp); |
3531 freemsg(mp); |
3520 return (error); |
3532 return (error); |
3521 } |
3533 } |
3567 break; |
3579 break; |
3568 } |
3580 } |
3569 /* FALLTHRU */ |
3581 /* FALLTHRU */ |
3570 default: |
3582 default: |
3571 failed: |
3583 failed: |
|
3584 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
|
3585 ixa->ixa_cpid = connp->conn_cpid; |
3572 ixa_refrele(ixa); |
3586 ixa_refrele(ixa); |
3573 freemsg(mp); |
3587 freemsg(mp); |
3574 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3588 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
3575 return (error); |
3589 return (error); |
3576 } |
3590 } |
3610 connp->conn_saddr_v6 = connp->conn_bound_addr_v6; |
3624 connp->conn_saddr_v6 = connp->conn_bound_addr_v6; |
3611 connp->conn_v6lastdst = ipv6_all_zeros; |
3625 connp->conn_v6lastdst = ipv6_all_zeros; |
3612 mutex_exit(&connp->conn_lock); |
3626 mutex_exit(&connp->conn_lock); |
3613 break; |
3627 break; |
3614 } |
3628 } |
|
3629 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
|
3630 ixa->ixa_cpid = connp->conn_cpid; |
3615 ixa_refrele(ixa); |
3631 ixa_refrele(ixa); |
3616 return (error); |
3632 return (error); |
3617 } |
3633 } |
3618 |
3634 |
3619 |
3635 |
4407 connp->conn_saddr_v6 = connp->conn_bound_addr_v6; |
4423 connp->conn_saddr_v6 = connp->conn_bound_addr_v6; |
4408 connp->conn_v6lastdst = ipv6_all_zeros; |
4424 connp->conn_v6lastdst = ipv6_all_zeros; |
4409 mutex_exit(&connp->conn_lock); |
4425 mutex_exit(&connp->conn_lock); |
4410 break; |
4426 break; |
4411 } |
4427 } |
|
4428 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
|
4429 ixa->ixa_cpid = connp->conn_cpid; |
4412 ixa_refrele(ixa); |
4430 ixa_refrele(ixa); |
4413 return (error); |
4431 return (error); |
4414 |
4432 |
4415 ud_error: |
4433 ud_error: |
4416 if (ixa != NULL) |
4434 ixa->ixa_cred = connp->conn_cred; /* Restore */ |
4417 ixa_refrele(ixa); |
4435 ixa->ixa_cpid = connp->conn_cpid; |
|
4436 ixa_refrele(ixa); |
4418 |
4437 |
4419 freemsg(data_mp); |
4438 freemsg(data_mp); |
4420 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
4439 BUMP_MIB(&us->us_udp_mib, udpOutErrors); |
4421 UDP_STAT(us, udp_out_err_output); |
4440 UDP_STAT(us, udp_out_err_output); |
4422 return (error); |
4441 return (error); |
6198 connp->conn_faddr_v6 = v6dst; |
6217 connp->conn_faddr_v6 = v6dst; |
6199 connp->conn_flowinfo = flowinfo; |
6218 connp->conn_flowinfo = flowinfo; |
6200 } |
6219 } |
6201 mutex_exit(&udpf->uf_lock); |
6220 mutex_exit(&udpf->uf_lock); |
6202 |
6221 |
|
6222 /* |
|
6223 * We update our cred/cpid based on the caller of connect |
|
6224 */ |
|
6225 if (connp->conn_cred != cr) { |
|
6226 crhold(cr); |
|
6227 crfree(connp->conn_cred); |
|
6228 connp->conn_cred = cr; |
|
6229 } |
|
6230 connp->conn_cpid = pid; |
6203 ixa->ixa_cred = cr; |
6231 ixa->ixa_cred = cr; |
6204 ixa->ixa_cpid = pid; |
6232 ixa->ixa_cpid = pid; |
6205 if (is_system_labeled()) { |
6233 if (is_system_labeled()) { |
6206 /* We need to restart with a label based on the cred */ |
6234 /* We need to restart with a label based on the cred */ |
6207 ip_xmit_attr_restore_tsl(ixa, ixa->ixa_cred); |
6235 ip_xmit_attr_restore_tsl(ixa, ixa->ixa_cred); |