Deleted Added
full compact
udp6_usrreq.c (242079) udp6_usrreq.c (242463)
1/*-
2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
3 * Copyright (c) 2010-2011 Juniper Networks, Inc.
4 * All rights reserved.
5 *
6 * Portions of this software were developed by Robert N. M. Watson under
7 * contract to Juniper Networks, Inc.
8 *

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

62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 *
66 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
67 */
68
69#include <sys/cdefs.h>
1/*-
2 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
3 * Copyright (c) 2010-2011 Juniper Networks, Inc.
4 * All rights reserved.
5 *
6 * Portions of this software were developed by Robert N. M. Watson under
7 * contract to Juniper Networks, Inc.
8 *

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

62 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64 * SUCH DAMAGE.
65 *
66 * @(#)udp_usrreq.c 8.6 (Berkeley) 5/23/95
67 */
68
69#include <sys/cdefs.h>
70__FBSDID("$FreeBSD: head/sys/netinet6/udp6_usrreq.c 242079 2012-10-25 09:39:14Z ae $");
70__FBSDID("$FreeBSD: head/sys/netinet6/udp6_usrreq.c 242463 2012-11-02 01:20:55Z ae $");
71
72#include "opt_inet.h"
73#include "opt_inet6.h"
74#include "opt_ipfw.h"
75#include "opt_ipsec.h"
76
77#include <sys/param.h>
78#include <sys/jail.h>

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

87#include <sys/socketvar.h>
88#include <sys/sx.h>
89#include <sys/sysctl.h>
90#include <sys/syslog.h>
91#include <sys/systm.h>
92
93#include <net/if.h>
94#include <net/if_types.h>
71
72#include "opt_inet.h"
73#include "opt_inet6.h"
74#include "opt_ipfw.h"
75#include "opt_ipsec.h"
76
77#include <sys/param.h>
78#include <sys/jail.h>

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

87#include <sys/socketvar.h>
88#include <sys/sx.h>
89#include <sys/sysctl.h>
90#include <sys/syslog.h>
91#include <sys/systm.h>
92
93#include <net/if.h>
94#include <net/if_types.h>
95#include <net/pfil.h>
96#include <net/route.h>
97
98#include <netinet/in.h>
99#include <netinet/in_pcb.h>
100#include <netinet/in_systm.h>
101#include <netinet/in_var.h>
102#include <netinet/ip.h>
103#include <netinet/ip_icmp.h>

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

391 }
392 /*
393 * Locate pcb for datagram.
394 */
395
396 /*
397 * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain.
398 */
95#include <net/route.h>
96
97#include <netinet/in.h>
98#include <netinet/in_pcb.h>
99#include <netinet/in_systm.h>
100#include <netinet/in_var.h>
101#include <netinet/ip.h>
102#include <netinet/ip_icmp.h>

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

390 }
391 /*
392 * Locate pcb for datagram.
393 */
394
395 /*
396 * Grab info from PACKET_TAG_IPFORWARD tag prepended to the chain.
397 */
399 if (V_pfilforward != 0 &&
398 if ((m->m_flags & M_IP6_NEXTHOP) &&
400 (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) {
401 struct sockaddr_in6 *next_hop6;
402
403 next_hop6 = (struct sockaddr_in6 *)(fwd_tag + 1);
404
405 /*
406 * Transparently forwarded. Pretend to be the destination.
407 * Already got one like this?

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

418 inp = in6_pcblookup(&V_udbinfo, &ip6->ip6_src,
419 uh->uh_sport, &next_hop6->sin6_addr,
420 next_hop6->sin6_port ? htons(next_hop6->sin6_port) :
421 uh->uh_dport, INPLOOKUP_WILDCARD |
422 INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif);
423 }
424 /* Remove the tag from the packet. We don't need it anymore. */
425 m_tag_delete(m, fwd_tag);
399 (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) {
400 struct sockaddr_in6 *next_hop6;
401
402 next_hop6 = (struct sockaddr_in6 *)(fwd_tag + 1);
403
404 /*
405 * Transparently forwarded. Pretend to be the destination.
406 * Already got one like this?

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

417 inp = in6_pcblookup(&V_udbinfo, &ip6->ip6_src,
418 uh->uh_sport, &next_hop6->sin6_addr,
419 next_hop6->sin6_port ? htons(next_hop6->sin6_port) :
420 uh->uh_dport, INPLOOKUP_WILDCARD |
421 INPLOOKUP_RLOCKPCB, m->m_pkthdr.rcvif);
422 }
423 /* Remove the tag from the packet. We don't need it anymore. */
424 m_tag_delete(m, fwd_tag);
425 m->m_flags &= ~M_IP6_NEXTHOP;
426 } else
427 inp = in6_pcblookup_mbuf(&V_udbinfo, &ip6->ip6_src,
428 uh->uh_sport, &ip6->ip6_dst, uh->uh_dport,
429 INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB,
430 m->m_pkthdr.rcvif, m);
431 if (inp == NULL) {
432 if (udp_log_in_vain) {
433 char ip6bufs[INET6_ADDRSTRLEN];

--- 728 unchanged lines hidden ---
426 } else
427 inp = in6_pcblookup_mbuf(&V_udbinfo, &ip6->ip6_src,
428 uh->uh_sport, &ip6->ip6_dst, uh->uh_dport,
429 INPLOOKUP_WILDCARD | INPLOOKUP_RLOCKPCB,
430 m->m_pkthdr.rcvif, m);
431 if (inp == NULL) {
432 if (udp_log_in_vain) {
433 char ip6bufs[INET6_ADDRSTRLEN];

--- 728 unchanged lines hidden ---