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 122807 2003-11-16 18:25:20Z 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 error = mac_setsockopt_label(sopt->sopt_td->td_ucred,
1456 so, &extmac);
1457#else
1458 error = EOPNOTSUPP;
1459#endif
1460 break;
1461 default:
1462 error = ENOPROTOOPT;
1463 break;
1464 }

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

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

--- 285 unchanged lines hidden ---