Deleted Added
full compact
tcp_usrreq.c (287830) tcp_usrreq.c (289276)
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1993
3 * The Regents of the University of California.
4 * Copyright (c) 2006-2007 Robert N. M. Watson
5 * Copyright (c) 2010-2011 Juniper Networks, Inc.
6 * All rights reserved.
7 *
8 * Portions of this software were developed by Robert N. M. Watson under

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

31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
36 */
37
38#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1982, 1986, 1988, 1993
3 * The Regents of the University of California.
4 * Copyright (c) 2006-2007 Robert N. M. Watson
5 * Copyright (c) 2010-2011 Juniper Networks, Inc.
6 * All rights reserved.
7 *
8 * Portions of this software were developed by Robert N. M. Watson under

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

31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 * SUCH DAMAGE.
34 *
35 * From: @(#)tcp_usrreq.c 8.2 (Berkeley) 1/3/94
36 */
37
38#include <sys/cdefs.h>
39__FBSDID("$FreeBSD: head/sys/netinet/tcp_usrreq.c 287830 2015-09-15 20:04:30Z hiren $");
39__FBSDID("$FreeBSD: head/sys/netinet/tcp_usrreq.c 289276 2015-10-14 00:35:37Z hiren $");
40
41#include "opt_ddb.h"
42#include "opt_inet.h"
43#include "opt_inet6.h"
44#include "opt_tcpdebug.h"
45
46#include <sys/param.h>
47#include <sys/systm.h>

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

81#include <netinet6/ip6_var.h>
82#include <netinet6/scope6_var.h>
83#endif
84#include <netinet/tcp_fsm.h>
85#include <netinet/tcp_seq.h>
86#include <netinet/tcp_timer.h>
87#include <netinet/tcp_var.h>
88#include <netinet/tcpip.h>
40
41#include "opt_ddb.h"
42#include "opt_inet.h"
43#include "opt_inet6.h"
44#include "opt_tcpdebug.h"
45
46#include <sys/param.h>
47#include <sys/systm.h>

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

81#include <netinet6/ip6_var.h>
82#include <netinet6/scope6_var.h>
83#endif
84#include <netinet/tcp_fsm.h>
85#include <netinet/tcp_seq.h>
86#include <netinet/tcp_timer.h>
87#include <netinet/tcp_var.h>
88#include <netinet/tcpip.h>
89#ifdef TCPPCAP
90#include <netinet/tcp_pcap.h>
91#endif
89#ifdef TCPDEBUG
90#include <netinet/tcp_debug.h>
91#endif
92#ifdef TCP_OFFLOAD
93#include <netinet/tcp_offload.h>
94#endif
95
96/*

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

1572 INP_WLOCK_RECHECK(inp);
1573 tp->t_keepcnt = ui;
1574 if ((tp->t_state == TCPS_FIN_WAIT_2) &&
1575 (TP_MAXIDLE(tp) > 0))
1576 tcp_timer_activate(tp, TT_2MSL,
1577 TP_MAXIDLE(tp));
1578 goto unlock_and_done;
1579
92#ifdef TCPDEBUG
93#include <netinet/tcp_debug.h>
94#endif
95#ifdef TCP_OFFLOAD
96#include <netinet/tcp_offload.h>
97#endif
98
99/*

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

1575 INP_WLOCK_RECHECK(inp);
1576 tp->t_keepcnt = ui;
1577 if ((tp->t_state == TCPS_FIN_WAIT_2) &&
1578 (TP_MAXIDLE(tp) > 0))
1579 tcp_timer_activate(tp, TT_2MSL,
1580 TP_MAXIDLE(tp));
1581 goto unlock_and_done;
1582
1583#ifdef TCPPCAP
1584 case TCP_PCAP_OUT:
1585 case TCP_PCAP_IN:
1586 INP_WUNLOCK(inp);
1587 error = sooptcopyin(sopt, &optval, sizeof optval,
1588 sizeof optval);
1589 if (error)
1590 return (error);
1591
1592 INP_WLOCK_RECHECK(inp);
1593 if (optval >= 0)
1594 tcp_pcap_set_sock_max(TCP_PCAP_OUT ?
1595 &(tp->t_outpkts) : &(tp->t_inpkts),
1596 optval);
1597 else
1598 error = EINVAL;
1599 goto unlock_and_done;
1600#endif
1601
1580 default:
1581 INP_WUNLOCK(inp);
1582 error = ENOPROTOOPT;
1583 break;
1584 }
1585 break;
1586
1587 case SOPT_GET:

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

1642 break;
1643 case TCP_KEEPCNT:
1644 ui = tp->t_keepcnt;
1645 break;
1646 }
1647 INP_WUNLOCK(inp);
1648 error = sooptcopyout(sopt, &ui, sizeof(ui));
1649 break;
1602 default:
1603 INP_WUNLOCK(inp);
1604 error = ENOPROTOOPT;
1605 break;
1606 }
1607 break;
1608
1609 case SOPT_GET:

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

1664 break;
1665 case TCP_KEEPCNT:
1666 ui = tp->t_keepcnt;
1667 break;
1668 }
1669 INP_WUNLOCK(inp);
1670 error = sooptcopyout(sopt, &ui, sizeof(ui));
1671 break;
1672#ifdef TCPPCAP
1673 case TCP_PCAP_OUT:
1674 case TCP_PCAP_IN:
1675 optval = tcp_pcap_get_sock_max(TCP_PCAP_OUT ?
1676 &(tp->t_outpkts) : &(tp->t_inpkts));
1677 INP_WUNLOCK(inp);
1678 error = sooptcopyout(sopt, &optval, sizeof optval);
1679 break;
1680#endif
1650 default:
1651 INP_WUNLOCK(inp);
1652 error = ENOPROTOOPT;
1653 break;
1654 }
1655 break;
1656 }
1657 return (error);

--- 459 unchanged lines hidden ---
1681 default:
1682 INP_WUNLOCK(inp);
1683 error = ENOPROTOOPT;
1684 break;
1685 }
1686 break;
1687 }
1688 return (error);

--- 459 unchanged lines hidden ---