Deleted Added
full compact
ip6_forward.c (121283) ip6_forward.c (121315)
1/* $FreeBSD: head/sys/netinet6/ip6_forward.c 121283 2003-10-20 15:27:48Z ume $ */
1/* $FreeBSD: head/sys/netinet6/ip6_forward.c 121315 2003-10-21 20:05:32Z ume $ */
2/* $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

109 int srcrt;
110{
111 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
112 struct sockaddr_in6 *dst;
113 struct rtentry *rt;
114 int error, type = 0, code = 0;
115 struct mbuf *mcopy = NULL;
116 struct ifnet *origifp; /* maybe unnecessary */
2/* $KAME: ip6_forward.c,v 1.69 2001/05/17 03:48:30 itojun Exp $ */
3
4/*
5 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions

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

109 int srcrt;
110{
111 struct ip6_hdr *ip6 = mtod(m, struct ip6_hdr *);
112 struct sockaddr_in6 *dst;
113 struct rtentry *rt;
114 int error, type = 0, code = 0;
115 struct mbuf *mcopy = NULL;
116 struct ifnet *origifp; /* maybe unnecessary */
117 u_int32_t srczone, dstzone;
117#ifdef IPSEC
118 struct secpolicy *sp = NULL;
119#endif
120
121#ifdef IPSEC
122 /*
123 * Check AH/ESP integrity.
124 */

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

355
356 /*
357 * Scope check: if a packet can't be delivered to its destination
358 * for the reason that the destination is beyond the scope of the
359 * source address, discard the packet and return an icmp6 destination
360 * unreachable error with Code 2 (beyond scope of source address).
361 * [draft-ietf-ipngwg-icmp-v3-02.txt, Section 3.1]
362 */
118#ifdef IPSEC
119 struct secpolicy *sp = NULL;
120#endif
121
122#ifdef IPSEC
123 /*
124 * Check AH/ESP integrity.
125 */

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

356
357 /*
358 * Scope check: if a packet can't be delivered to its destination
359 * for the reason that the destination is beyond the scope of the
360 * source address, discard the packet and return an icmp6 destination
361 * unreachable error with Code 2 (beyond scope of source address).
362 * [draft-ietf-ipngwg-icmp-v3-02.txt, Section 3.1]
363 */
363 if (in6_addr2scopeid(m->m_pkthdr.rcvif, &ip6->ip6_src) !=
364 in6_addr2scopeid(rt->rt_ifp, &ip6->ip6_src)) {
364 if (in6_addr2zoneid(m->m_pkthdr.rcvif, &ip6->ip6_src, &srczone) ||
365 in6_addr2zoneid(rt->rt_ifp, &ip6->ip6_src, &dstzone) ||
366 srczone != dstzone) {
365 ip6stat.ip6s_cantforward++;
366 ip6stat.ip6s_badscope++;
367 in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard);
368
369 if (ip6_log_time + ip6_log_interval < time_second) {
370 ip6_log_time = time_second;
371 log(LOG_DEBUG,
372 "cannot forward "

--- 209 unchanged lines hidden ---
367 ip6stat.ip6s_cantforward++;
368 ip6stat.ip6s_badscope++;
369 in6_ifstat_inc(rt->rt_ifp, ifs6_in_discard);
370
371 if (ip6_log_time + ip6_log_interval < time_second) {
372 ip6_log_time = time_second;
373 log(LOG_DEBUG,
374 "cannot forward "

--- 209 unchanged lines hidden ---