Deleted Added
full compact
tcp_syncache.c (235961) tcp_syncache.c (236170)
1/*-
2 * Copyright (c) 2001 McAfee, Inc.
3 * Copyright (c) 2006 Andre Oppermann, Internet Business Solutions AG
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Jonathan Lemon
7 * and McAfee Research, the Security Research Division of McAfee, Inc. under
8 * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

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

26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 McAfee, Inc.
3 * Copyright (c) 2006 Andre Oppermann, Internet Business Solutions AG
4 * All rights reserved.
5 *
6 * This software was developed for the FreeBSD Project by Jonathan Lemon
7 * and McAfee Research, the Security Research Division of McAfee, Inc. under
8 * DARPA/SPAWAR contract N66001-01-C-8035 ("CBOSS"), as part of the

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

26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/netinet/tcp_syncache.c 235961 2012-05-25 02:23:26Z bz $");
34__FBSDID("$FreeBSD: head/sys/netinet/tcp_syncache.c 236170 2012-05-28 09:30:13Z bz $");
35
36#include "opt_inet.h"
37#include "opt_inet6.h"
38#include "opt_ipsec.h"
39#include "opt_pcbgroup.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>

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

1468 ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) + optlen);
1469 else
1470#endif
1471 ip->ip_len += optlen;
1472 } else
1473 optlen = 0;
1474
1475 M_SETFIB(m, sc->sc_inc.inc_fibnum);
35
36#include "opt_inet.h"
37#include "opt_inet6.h"
38#include "opt_ipsec.h"
39#include "opt_pcbgroup.h"
40
41#include <sys/param.h>
42#include <sys/systm.h>

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

1468 ip6->ip6_plen = htons(ntohs(ip6->ip6_plen) + optlen);
1469 else
1470#endif
1471 ip->ip_len += optlen;
1472 } else
1473 optlen = 0;
1474
1475 M_SETFIB(m, sc->sc_inc.inc_fibnum);
1476 m->m_pkthdr.csum_flags = CSUM_TCP;
1477 m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
1478#ifdef INET6
1479 if (sc->sc_inc.inc_flags & INC_ISIPV6) {
1476 m->m_pkthdr.csum_data = offsetof(struct tcphdr, th_sum);
1477#ifdef INET6
1478 if (sc->sc_inc.inc_flags & INC_ISIPV6) {
1479 m->m_pkthdr.csum_flags = CSUM_TCP_IPV6;
1480 th->th_sum = in6_cksum_pseudo(ip6, tlen + optlen - hlen,
1481 IPPROTO_TCP, 0);
1482 ip6->ip6_hlim = in6_selecthlim(NULL, NULL);
1483 error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL);
1484 }
1485#endif
1486#if defined(INET6) && defined(INET)
1487 else
1488#endif
1489#ifdef INET
1490 {
1480 th->th_sum = in6_cksum_pseudo(ip6, tlen + optlen - hlen,
1481 IPPROTO_TCP, 0);
1482 ip6->ip6_hlim = in6_selecthlim(NULL, NULL);
1483 error = ip6_output(m, NULL, NULL, 0, NULL, NULL, NULL);
1484 }
1485#endif
1486#if defined(INET6) && defined(INET)
1487 else
1488#endif
1489#ifdef INET
1490 {
1491 m->m_pkthdr.csum_flags = CSUM_TCP;
1491 th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
1492 htons(tlen + optlen - hlen + IPPROTO_TCP));
1493 error = ip_output(m, sc->sc_ipopts, NULL, 0, NULL, NULL);
1494 }
1495#endif
1496 return (error);
1497}
1498

--- 352 unchanged lines hidden ---
1492 th->th_sum = in_pseudo(ip->ip_src.s_addr, ip->ip_dst.s_addr,
1493 htons(tlen + optlen - hlen + IPPROTO_TCP));
1494 error = ip_output(m, sc->sc_ipopts, NULL, 0, NULL, NULL);
1495 }
1496#endif
1497 return (error);
1498}
1499

--- 352 unchanged lines hidden ---