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 */ |
117 u_int32_t srczone, dstzone; |
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 */ |
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) { |
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 --- |