alias_util.c (ed01a5821550bf9859165f24c95b30c5f1b69f22) alias_util.c (9fa0fd268273d90e765d9ebfe0be87ea4d64e138)
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

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

97 u_short *ptr;
98 struct tcphdr *tc;
99 int nhdr, ntcp, nbytes;
100 int sum, oddbyte;
101
102 nhdr = pip->ip_hl << 2;
103 ntcp = ntohs(pip->ip_len) - nhdr;
104
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

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

97 u_short *ptr;
98 struct tcphdr *tc;
99 int nhdr, ntcp, nbytes;
100 int sum, oddbyte;
101
102 nhdr = pip->ip_hl << 2;
103 ntcp = ntohs(pip->ip_len) - nhdr;
104
105 tc = (struct tcphdr *)((char *)pip + nhdr);
105 tc = (struct tcphdr *)ip_next(pip);
106 ptr = (u_short *) tc;
107
108/* Add up TCP header and data */
109 nbytes = ntcp;
110 sum = 0;
111 while (nbytes > 1) {
112 sum += *ptr++;
113 nbytes -= 2;

--- 51 unchanged lines hidden ---
106 ptr = (u_short *) tc;
107
108/* Add up TCP header and data */
109 nbytes = ntcp;
110 sum = 0;
111 while (nbytes > 1) {
112 sum += *ptr++;
113 nbytes -= 2;

--- 51 unchanged lines hidden ---