cxgb_cpl_io.c (178767) | cxgb_cpl_io.c (180583) |
---|---|
1/************************************************************************** 2 3Copyright (c) 2007-2008, Chelsio Inc. 4All rights reserved. 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are met: 8 --- 14 unchanged lines hidden (view full) --- 23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26POSSIBILITY OF SUCH DAMAGE. 27 28***************************************************************************/ 29 30#include <sys/cdefs.h> | 1/************************************************************************** 2 3Copyright (c) 2007-2008, Chelsio Inc. 4All rights reserved. 5 6Redistribution and use in source and binary forms, with or without 7modification, are permitted provided that the following conditions are met: 8 --- 14 unchanged lines hidden (view full) --- 23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26POSSIBILITY OF SUCH DAMAGE. 27 28***************************************************************************/ 29 30#include <sys/cdefs.h> |
31__FBSDID("$FreeBSD: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c 178767 2008-05-05 01:41:53Z kmacy $"); | 31__FBSDID("$FreeBSD: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c 180583 2008-07-18 06:12:31Z kmacy $"); |
32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/fcntl.h> 36#include <sys/kernel.h> 37#include <sys/limits.h> 38#include <sys/ktr.h> 39#include <sys/lock.h> --- 1629 unchanged lines hidden (view full) --- 1669t3_tcp_ctloutput(struct socket *so, struct sockopt *sopt) 1670{ 1671 int err = 0; 1672 size_t copied; 1673 1674 if (sopt->sopt_name != TCP_CONGESTION && 1675 sopt->sopt_name != TCP_NODELAY) 1676 return (EOPNOTSUPP); | 32 33#include <sys/param.h> 34#include <sys/systm.h> 35#include <sys/fcntl.h> 36#include <sys/kernel.h> 37#include <sys/limits.h> 38#include <sys/ktr.h> 39#include <sys/lock.h> --- 1629 unchanged lines hidden (view full) --- 1669t3_tcp_ctloutput(struct socket *so, struct sockopt *sopt) 1670{ 1671 int err = 0; 1672 size_t copied; 1673 1674 if (sopt->sopt_name != TCP_CONGESTION && 1675 sopt->sopt_name != TCP_NODELAY) 1676 return (EOPNOTSUPP); |
1677 | 1677 |
1678 if (sopt->sopt_name == TCP_CONGESTION) { 1679 char name[TCP_CA_NAME_MAX]; 1680 int optlen = sopt->sopt_valsize; 1681 struct tcpcb *tp; 1682 | 1678 if (sopt->sopt_name == TCP_CONGESTION) { 1679 char name[TCP_CA_NAME_MAX]; 1680 int optlen = sopt->sopt_valsize; 1681 struct tcpcb *tp; 1682 |
1683 if (sopt->sopt_dir == SOPT_GET) { 1684 KASSERT(0, ("unimplemented")); 1685 return (EOPNOTSUPP); 1686 } 1687 |
|
1683 if (optlen < 1) 1684 return (EINVAL); 1685 1686 err = copyinstr(sopt->sopt_val, name, 1687 min(TCP_CA_NAME_MAX - 1, optlen), &copied); 1688 if (err) 1689 return (err); 1690 if (copied < 1) --- 9 unchanged lines hidden (view full) --- 1700#endif 1701 } else 1702 return (err); 1703 } else { 1704 int optval, oldval; 1705 struct inpcb *inp; 1706 struct tcpcb *tp; 1707 | 1688 if (optlen < 1) 1689 return (EINVAL); 1690 1691 err = copyinstr(sopt->sopt_val, name, 1692 min(TCP_CA_NAME_MAX - 1, optlen), &copied); 1693 if (err) 1694 return (err); 1695 if (copied < 1) --- 9 unchanged lines hidden (view full) --- 1705#endif 1706 } else 1707 return (err); 1708 } else { 1709 int optval, oldval; 1710 struct inpcb *inp; 1711 struct tcpcb *tp; 1712 |
1713 if (sopt->sopt_dir == SOPT_GET) 1714 return (EOPNOTSUPP); 1715 |
|
1708 err = sooptcopyin(sopt, &optval, sizeof optval, 1709 sizeof optval); 1710 1711 if (err) 1712 return (err); 1713 1714 inp = so_sotoinpcb(so); 1715 tp = inp_inpcbtotcpcb(inp); --- 2743 unchanged lines hidden --- | 1716 err = sooptcopyin(sopt, &optval, sizeof optval, 1717 sizeof optval); 1718 1719 if (err) 1720 return (err); 1721 1722 inp = so_sotoinpcb(so); 1723 tp = inp_inpcbtotcpcb(inp); --- 2743 unchanged lines hidden --- |