Deleted Added
full compact
tcpmss.c (69303) tcpmss.c (78410)
1/*-
2 * Copyright (c) 2000 Ruslan Ermilov and Brian Somers <brian@Awfulhak.org>
3 * 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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
1/*-
2 * Copyright (c) 2000 Ruslan Ermilov and Brian Somers <brian@Awfulhak.org>
3 * 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

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

18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/usr.sbin/ppp/tcpmss.c 69303 2000-11-28 13:18:35Z brian $
26 * $FreeBSD: head/usr.sbin/ppp/tcpmss.c 78410 2001-06-18 14:59:36Z brian $
27 */
28
29#include <sys/param.h>
30
27 */
28
29#include <sys/param.h>
30
31#include <sys/socket.h>
32#include <net/route.h>
31#include <netinet/in_systm.h>
32#include <netinet/in.h>
33#include <netinet/ip.h>
34#include <netinet/tcp.h>
35#include <sys/un.h>
36
37#include <termios.h>
38

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

49#include "ccp.h"
50#include "link.h"
51#include "iplist.h"
52#include "slcompress.h"
53#include "ipcp.h"
54#include "filter.h"
55#include "descriptor.h"
56#include "mp.h"
33#include <netinet/in_systm.h>
34#include <netinet/in.h>
35#include <netinet/ip.h>
36#include <netinet/tcp.h>
37#include <sys/un.h>
38
39#include <termios.h>
40

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

51#include "ccp.h"
52#include "link.h"
53#include "iplist.h"
54#include "slcompress.h"
55#include "ipcp.h"
56#include "filter.h"
57#include "descriptor.h"
58#include "mp.h"
59#include "iface.h"
57#ifndef NORADIUS
58#include "radius.h"
59#endif
60#include "bundle.h"
61
62
63/*-
64 * We are in a liberal position about MSS

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

88 /*
89 * Check for MSS option only for TCP packets with zero fragment offsets
90 * and correct total and header lengths.
91 */
92 if (pip->ip_p == IPPROTO_TCP && (ntohs(pip->ip_off) & IP_OFFMASK) == 0 &&
93 ntohs(pip->ip_len) == plen && hlen <= plen &&
94 plen - hlen >= sizeof(struct tcphdr))
95 MSSFixup((struct tcphdr *)(MBUF_CTOP(bp) + hlen), plen - hlen,
60#ifndef NORADIUS
61#include "radius.h"
62#endif
63#include "bundle.h"
64
65
66/*-
67 * We are in a liberal position about MSS

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

91 /*
92 * Check for MSS option only for TCP packets with zero fragment offsets
93 * and correct total and header lengths.
94 */
95 if (pip->ip_p == IPPROTO_TCP && (ntohs(pip->ip_off) & IP_OFFMASK) == 0 &&
96 ntohs(pip->ip_len) == plen && hlen <= plen &&
97 plen - hlen >= sizeof(struct tcphdr))
98 MSSFixup((struct tcphdr *)(MBUF_CTOP(bp) + hlen), plen - hlen,
96 MAXMSS(bundle->mtu));
99 MAXMSS(bundle->iface->mtu));
97
98 return bp;
99}
100
101/*-
102 * The following macro is used to update an
103 * internet checksum. "acc" is a 32-bit
104 * accumulation of all the changes to the

--- 64 unchanged lines hidden ---
100
101 return bp;
102}
103
104/*-
105 * The following macro is used to update an
106 * internet checksum. "acc" is a 32-bit
107 * accumulation of all the changes to the

--- 64 unchanged lines hidden ---