Deleted Added
full compact
alias_irc.c (168346) alias_irc.c (176884)
1/*-
2 * Copyright (c) 2001 Charles Mott <cm@linktel.net>
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

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

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
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2001 Charles Mott <cm@linktel.net>
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

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

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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/netinet/libalias/alias_irc.c 168346 2007-04-04 03:16:59Z kan $");
28__FBSDID("$FreeBSD: head/sys/netinet/libalias/alias_irc.c 176884 2008-03-06 21:50:41Z piso $");
29
30/* Alias_irc.c intercepts packages contain IRC CTCP commands, and
31 changes DCC commands to export a port on the aliasing host instead
32 of an aliased host.
33
34 For this routine to work, the DCC command must fit entirely into a
35 single TCP packet. This will usually happen, but is not
36 guaranteed.

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

427 iCopy = iCopy > maxsize - copyat ? maxsize - copyat : iCopy;
428 memcpy(sptr + copyat, newpacket, iCopy);
429
430/* Save information regarding modified seq and ack numbers */
431 {
432 int delta;
433
434 SetAckModified(lnk);
29
30/* Alias_irc.c intercepts packages contain IRC CTCP commands, and
31 changes DCC commands to export a port on the aliasing host instead
32 of an aliased host.
33
34 For this routine to work, the DCC command must fit entirely into a
35 single TCP packet. This will usually happen, but is not
36 guaranteed.

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

427 iCopy = iCopy > maxsize - copyat ? maxsize - copyat : iCopy;
428 memcpy(sptr + copyat, newpacket, iCopy);
429
430/* Save information regarding modified seq and ack numbers */
431 {
432 int delta;
433
434 SetAckModified(lnk);
435 delta = GetDeltaSeqOut(pip, lnk);
436 AddSeq(pip, lnk, delta + copyat + iCopy - dlen);
435 tc = (struct tcphdr *)ip_next(pip);
436 delta = GetDeltaSeqOut(tc->th_seq, lnk);
437 AddSeq(lnk, delta + copyat + iCopy - dlen, pip->ip_hl,
438 pip->ip_len, tc->th_seq, tc->th_off);
437 }
438
439 /* Revise IP header */
440 {
441 u_short new_len;
442
443 new_len = htons(hlen + iCopy + copyat);
444 DifferentialChecksum(&pip->ip_sum,

--- 35 unchanged lines hidden ---
439 }
440
441 /* Revise IP header */
442 {
443 u_short new_len;
444
445 new_len = htons(hlen + iCopy + copyat);
446 DifferentialChecksum(&pip->ip_sum,

--- 35 unchanged lines hidden ---