Deleted Added
sdiff udiff text old ( 122775 ) new ( 122807 )
full compact
1/*
2 * Copyright (c) 1982, 1986, 1988, 1990, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

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

29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)uipc_socket.c 8.3 (Berkeley) 4/15/94
34 */
35
36#include <sys/cdefs.h>
37__FBSDID("$FreeBSD: head/sys/kern/uipc_socket.c 122775 2003-11-16 03:53:36Z rwatson $");
38
39#include "opt_inet.h"
40#include "opt_mac.h"
41#include "opt_zero.h"
42
43#include <sys/param.h>
44#include <sys/systm.h>
45#include <sys/fcntl.h>

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

1447 }
1448 break;
1449 case SO_LABEL:
1450#ifdef MAC
1451 error = sooptcopyin(sopt, &extmac, sizeof extmac,
1452 sizeof extmac);
1453 if (error)
1454 goto bad;
1455
1456 error = mac_setsockopt_label_set(
1457 sopt->sopt_td->td_ucred, so, &extmac);
1458
1459#else
1460 error = EOPNOTSUPP;
1461#endif
1462 break;
1463 default:
1464 error = ENOPROTOOPT;
1465 break;
1466 }

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

1598 error = sooptcopyout(sopt, &tv, sizeof tv);
1599 break;
1600 case SO_LABEL:
1601#ifdef MAC
1602 error = sooptcopyin(sopt, &extmac, sizeof(extmac),
1603 sizeof(extmac));
1604 if (error)
1605 return (error);
1606 error = mac_getsockopt_label_get(
1607 sopt->sopt_td->td_ucred, so, &extmac);
1608 if (error)
1609 return (error);
1610 error = sooptcopyout(sopt, &extmac, sizeof extmac);
1611#else
1612 error = EOPNOTSUPP;
1613#endif
1614 break;
1615 case SO_PEERLABEL:
1616#ifdef MAC
1617 error = sooptcopyin(sopt, &extmac, sizeof(extmac),
1618 sizeof(extmac));
1619 if (error)
1620 return (error);
1621 error = mac_getsockopt_peerlabel_get(
1622 sopt->sopt_td->td_ucred, so, &extmac);
1623 if (error)
1624 return (error);
1625 error = sooptcopyout(sopt, &extmac, sizeof extmac);
1626#else
1627 error = EOPNOTSUPP;
1628#endif
1629 break;

--- 285 unchanged lines hidden ---