uipc_socket.c (bcf11e8d0048006ba97cb460a134cc23290428b2) uipc_socket.c (d8b0556c6dcaf4c506039f86af2b52b29524f89e)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California.
4 * Copyright (c) 2004 The FreeBSD Foundation
5 * Copyright (c) 2004-2008 Robert N. M. Watson
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

371 (prp->pr_domain->dom_family == PF_ROUTE))
372 so->so_fibnum = td->td_proc->p_fibnum;
373 else
374 so->so_fibnum = 0;
375 so->so_proto = prp;
376#ifdef MAC
377 mac_socket_create(cred, so);
378#endif
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California.
4 * Copyright (c) 2004 The FreeBSD Foundation
5 * Copyright (c) 2004-2008 Robert N. M. Watson
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

371 (prp->pr_domain->dom_family == PF_ROUTE))
372 so->so_fibnum = td->td_proc->p_fibnum;
373 else
374 so->so_fibnum = 0;
375 so->so_proto = prp;
376#ifdef MAC
377 mac_socket_create(cred, so);
378#endif
379 knlist_init(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv),
380 NULL, NULL, NULL);
381 knlist_init(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd),
382 NULL, NULL, NULL);
379 knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv));
380 knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd));
383 so->so_count = 1;
384 /*
385 * Auto-sizing of socket buffers is managed by the protocols and
386 * the appropriate flags must be set in the pru_attach function.
387 */
388 CURVNET_SET(so->so_vnet);
389 error = (*prp->pr_usrreqs->pru_attach)(so, proto, td);
390 CURVNET_RESTORE();

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

440 so->so_options = head->so_options &~ SO_ACCEPTCONN;
441 so->so_linger = head->so_linger;
442 so->so_state = head->so_state | SS_NOFDREF;
443 so->so_proto = head->so_proto;
444 so->so_cred = crhold(head->so_cred);
445#ifdef MAC
446 mac_socket_newconn(head, so);
447#endif
381 so->so_count = 1;
382 /*
383 * Auto-sizing of socket buffers is managed by the protocols and
384 * the appropriate flags must be set in the pru_attach function.
385 */
386 CURVNET_SET(so->so_vnet);
387 error = (*prp->pr_usrreqs->pru_attach)(so, proto, td);
388 CURVNET_RESTORE();

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

438 so->so_options = head->so_options &~ SO_ACCEPTCONN;
439 so->so_linger = head->so_linger;
440 so->so_state = head->so_state | SS_NOFDREF;
441 so->so_proto = head->so_proto;
442 so->so_cred = crhold(head->so_cred);
443#ifdef MAC
444 mac_socket_newconn(head, so);
445#endif
448 knlist_init(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv),
449 NULL, NULL, NULL);
450 knlist_init(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd),
451 NULL, NULL, NULL);
446 knlist_init_mtx(&so->so_rcv.sb_sel.si_note, SOCKBUF_MTX(&so->so_rcv));
447 knlist_init_mtx(&so->so_snd.sb_sel.si_note, SOCKBUF_MTX(&so->so_snd));
452 if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) ||
453 (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) {
454 sodealloc(so);
455 return (NULL);
456 }
457 so->so_rcv.sb_lowat = head->so_rcv.sb_lowat;
458 so->so_snd.sb_lowat = head->so_snd.sb_lowat;
459 so->so_rcv.sb_timeo = head->so_rcv.sb_timeo;

--- 2913 unchanged lines hidden ---
448 if (soreserve(so, head->so_snd.sb_hiwat, head->so_rcv.sb_hiwat) ||
449 (*so->so_proto->pr_usrreqs->pru_attach)(so, 0, NULL)) {
450 sodealloc(so);
451 return (NULL);
452 }
453 so->so_rcv.sb_lowat = head->so_rcv.sb_lowat;
454 so->so_snd.sb_lowat = head->so_snd.sb_lowat;
455 so->so_rcv.sb_timeo = head->so_rcv.sb_timeo;

--- 2913 unchanged lines hidden ---