Deleted Added
full compact
ip_mroute.c (133046) ip_mroute.c (133720)
1/*
2 * IP multicast forwarding procedures
3 *
4 * Written by David Waitzman, BBN Labs, August 1988.
5 * Modified by Steve Deering, Stanford, February 1989.
6 * Modified by Mark J. Steiglitz, Stanford, May, 1991
7 * Modified by Van Jacobson, LBL, January 1993
8 * Modified by Ajit Thyagarajan, PARC, August 1993
9 * Modified by Bill Fenner, PARC, April 1995
10 * Modified by Ahmed Helmy, SGI, June 1996
11 * Modified by George Edmond Eddy (Rusty), ISI, February 1998
12 * Modified by Pavlin Radoslavov, USC/ISI, May 1998, August 1999, October 2000
13 * Modified by Hitoshi Asaeda, WIDE, August 2000
14 * Modified by Pavlin Radoslavov, ICSI, October 2002
15 *
16 * MROUTING Revision: 3.5
17 * and PIM-SMv2 and PIM-DM support, advanced API support,
18 * bandwidth metering and signaling
19 *
1/*
2 * IP multicast forwarding procedures
3 *
4 * Written by David Waitzman, BBN Labs, August 1988.
5 * Modified by Steve Deering, Stanford, February 1989.
6 * Modified by Mark J. Steiglitz, Stanford, May, 1991
7 * Modified by Van Jacobson, LBL, January 1993
8 * Modified by Ajit Thyagarajan, PARC, August 1993
9 * Modified by Bill Fenner, PARC, April 1995
10 * Modified by Ahmed Helmy, SGI, June 1996
11 * Modified by George Edmond Eddy (Rusty), ISI, February 1998
12 * Modified by Pavlin Radoslavov, USC/ISI, May 1998, August 1999, October 2000
13 * Modified by Hitoshi Asaeda, WIDE, August 2000
14 * Modified by Pavlin Radoslavov, ICSI, October 2002
15 *
16 * MROUTING Revision: 3.5
17 * and PIM-SMv2 and PIM-DM support, advanced API support,
18 * bandwidth metering and signaling
19 *
20 * $FreeBSD: head/sys/netinet/ip_mroute.c 133046 2004-08-03 02:01:44Z hsu $
20 * $FreeBSD: head/sys/netinet/ip_mroute.c 133720 2004-08-14 15:32:40Z dwmalone $
21 */
22
23#include "opt_mac.h"
24#include "opt_mrouting.h"
21 */
22
23#include "opt_mac.h"
24#include "opt_mrouting.h"
25#include "opt_random_ip_id.h"
26
27#ifdef PIM
28#define _PIM_VT 1
29#endif
30
31#include <sys/param.h>
32#include <sys/kernel.h>
33#include <sys/lock.h>

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

1879 return;
1880 mb_copy->m_pkthdr.len = len + sizeof(multicast_encap_iphdr);
1881
1882 /*
1883 * fill in the encapsulating IP header.
1884 */
1885 ip_copy = mtod(mb_copy, struct ip *);
1886 *ip_copy = multicast_encap_iphdr;
25
26#ifdef PIM
27#define _PIM_VT 1
28#endif
29
30#include <sys/param.h>
31#include <sys/kernel.h>
32#include <sys/lock.h>

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

1878 return;
1879 mb_copy->m_pkthdr.len = len + sizeof(multicast_encap_iphdr);
1880
1881 /*
1882 * fill in the encapsulating IP header.
1883 */
1884 ip_copy = mtod(mb_copy, struct ip *);
1885 *ip_copy = multicast_encap_iphdr;
1887#ifdef RANDOM_IP_ID
1888 ip_copy->ip_id = ip_randomid();
1889#else
1890 ip_copy->ip_id = htons(ip_id++);
1891#endif
1886 ip_copy->ip_id = ip_newid();
1892 ip_copy->ip_len += len;
1893 ip_copy->ip_src = vifp->v_lcl_addr;
1894 ip_copy->ip_dst = vifp->v_rmt_addr;
1895
1896 /*
1897 * turn the encapsulated IP header back into a valid one.
1898 */
1899 ip = (struct ip *)((caddr_t)ip_copy + sizeof(multicast_encap_iphdr));

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

3088
3089 mb_first->m_pkthdr.len = len + mb_first->m_len;
3090
3091 /*
3092 * Fill in the encapsulating IP and PIM header
3093 */
3094 ip_outer = mtod(mb_first, struct ip *);
3095 *ip_outer = pim_encap_iphdr;
1887 ip_copy->ip_len += len;
1888 ip_copy->ip_src = vifp->v_lcl_addr;
1889 ip_copy->ip_dst = vifp->v_rmt_addr;
1890
1891 /*
1892 * turn the encapsulated IP header back into a valid one.
1893 */
1894 ip = (struct ip *)((caddr_t)ip_copy + sizeof(multicast_encap_iphdr));

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

3083
3084 mb_first->m_pkthdr.len = len + mb_first->m_len;
3085
3086 /*
3087 * Fill in the encapsulating IP and PIM header
3088 */
3089 ip_outer = mtod(mb_first, struct ip *);
3090 *ip_outer = pim_encap_iphdr;
3096#ifdef RANDOM_IP_ID
3097 ip_outer->ip_id = ip_randomid();
3098#else
3099 ip_outer->ip_id = htons(ip_id++);
3100#endif
3091 ip_outer->ip_id = ip_newid();
3101 ip_outer->ip_len = len + sizeof(pim_encap_iphdr) + sizeof(pim_encap_pimhdr);
3102 ip_outer->ip_src = viftable[vifi].v_lcl_addr;
3103 ip_outer->ip_dst = rt->mfc_rp;
3104 /*
3105 * Copy the inner header TOS to the outer header, and take care of the
3106 * IP_DF bit.
3107 */
3108 ip_outer->ip_tos = ip->ip_tos;

--- 327 unchanged lines hidden ---
3092 ip_outer->ip_len = len + sizeof(pim_encap_iphdr) + sizeof(pim_encap_pimhdr);
3093 ip_outer->ip_src = viftable[vifi].v_lcl_addr;
3094 ip_outer->ip_dst = rt->mfc_rp;
3095 /*
3096 * Copy the inner header TOS to the outer header, and take care of the
3097 * IP_DF bit.
3098 */
3099 ip_outer->ip_tos = ip->ip_tos;

--- 327 unchanged lines hidden ---