Deleted Added
full compact
xform_ipip.c (128370) xform_ipip.c (133720)
1/* $FreeBSD: head/sys/netipsec/xform_ipip.c 128370 2004-04-17 23:29:25Z luigi $ */
1/* $FreeBSD: head/sys/netipsec/xform_ipip.c 133720 2004-08-14 15:32:40Z dwmalone $ */
2/* $OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */
3/*
4 * The authors of this code are John Ioannidis (ji@tla.org),
5 * Angelos D. Keromytis (kermit@csd.uch.gr) and
6 * Niels Provos (provos@physnet.uni-hamburg.de).
7 *
8 * The original version of this code was written by John Ioannidis
9 * for BSD/OS in Athens, Greece, in November 1995.

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

36 * PURPOSE.
37 */
38
39/*
40 * IP-inside-IP processing
41 */
42#include "opt_inet.h"
43#include "opt_inet6.h"
2/* $OpenBSD: ip_ipip.c,v 1.25 2002/06/10 18:04:55 itojun Exp $ */
3/*
4 * The authors of this code are John Ioannidis (ji@tla.org),
5 * Angelos D. Keromytis (kermit@csd.uch.gr) and
6 * Niels Provos (provos@physnet.uni-hamburg.de).
7 *
8 * The original version of this code was written by John Ioannidis
9 * for BSD/OS in Athens, Greece, in November 1995.

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

36 * PURPOSE.
37 */
38
39/*
40 * IP-inside-IP processing
41 */
42#include "opt_inet.h"
43#include "opt_inet6.h"
44#include "opt_random_ip_id.h"
45
46#include <sys/param.h>
47#include <sys/systm.h>
48#include <sys/mbuf.h>
49#include <sys/socket.h>
50#include <sys/kernel.h>
51#include <sys/protosw.h>
52#include <sys/sysctl.h>

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

445 ipo->ip_v = IPVERSION;
446 ipo->ip_hl = 5;
447 ipo->ip_len = htons(m->m_pkthdr.len);
448 ipo->ip_ttl = ip_defttl;
449 ipo->ip_sum = 0;
450 ipo->ip_src = saidx->src.sin.sin_addr;
451 ipo->ip_dst = saidx->dst.sin.sin_addr;
452
44
45#include <sys/param.h>
46#include <sys/systm.h>
47#include <sys/mbuf.h>
48#include <sys/socket.h>
49#include <sys/kernel.h>
50#include <sys/protosw.h>
51#include <sys/sysctl.h>

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

444 ipo->ip_v = IPVERSION;
445 ipo->ip_hl = 5;
446 ipo->ip_len = htons(m->m_pkthdr.len);
447 ipo->ip_ttl = ip_defttl;
448 ipo->ip_sum = 0;
449 ipo->ip_src = saidx->src.sin.sin_addr;
450 ipo->ip_dst = saidx->dst.sin.sin_addr;
451
453#ifdef RANDOM_IP_ID
454 ipo->ip_id = ip_randomid();
455#else
456 ipo->ip_id = htons(ip_id++);
457#endif
452 ipo->ip_id = ip_newid();
458
459 /* If the inner protocol is IP... */
460 if (tp == IPVERSION) {
461 /* Save ECN notification */
462 m_copydata(m, sizeof(struct ip) +
463 offsetof(struct ip, ip_tos),
464 sizeof(u_int8_t), (caddr_t) &itos);
465

--- 229 unchanged lines hidden ---
453
454 /* If the inner protocol is IP... */
455 if (tp == IPVERSION) {
456 /* Save ECN notification */
457 m_copydata(m, sizeof(struct ip) +
458 offsetof(struct ip, ip_tos),
459 sizeof(u_int8_t), (caddr_t) &itos);
460

--- 229 unchanged lines hidden ---