Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys fix faith interface support. need testing.
details: https://anonhg.NetBSD.org/src/rev/62fd7d673e75
branches: trunk
changeset: 474724:62fd7d673e75
user: itojun <itojun%NetBSD.org@localhost>
date: Sat Jul 17 07:07:08 1999 +0000
description:
fix faith interface support. need testing.
(i understand this is a dirty hack, of course)
diffstat:
sys/netinet/tcp_input.c | 28 +++++++++++++++++++++++-----
sys/netinet6/in6_pcb.c | 17 ++++++++++++++---
sys/netinet6/in6_pcb.h | 6 +++---
3 files changed, 40 insertions(+), 11 deletions(-)
diffs (159 lines):
diff -r a25b5a9f49b9 -r 62fd7d673e75 sys/netinet/tcp_input.c
--- a/sys/netinet/tcp_input.c Sat Jul 17 06:57:59 1999 +0000
+++ b/sys/netinet/tcp_input.c Sat Jul 17 07:07:08 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tcp_input.c,v 1.86 1999/07/14 22:37:13 itojun Exp $ */
+/* $NetBSD: tcp_input.c,v 1.87 1999/07/17 07:07:08 itojun Exp $ */
/*
%%% portions-copyright-nrl-95
@@ -141,6 +141,7 @@
#include <net/if.h>
#include <net/route.h>
+#include <net/if_types.h>
#include <netinet/in.h>
#include <netinet/in_systm.h>
@@ -175,6 +176,8 @@
#include <netkey/key_debug.h>
#endif /*IPSEC*/
+#include "faith.h"
+
int tcprexmtthresh = 3;
int tcp_log_refused;
@@ -719,10 +722,11 @@
d.s6_addr16[5] = htons(0xffff);
bcopy(&ip->ip_dst, &d.s6_addr32[3], sizeof(ip->ip_dst));
in6p = in6_pcblookup_connect(&tcb6, &s, th->th_sport,
- &d, th->th_dport);
+ &d, th->th_dport, 0);
if (in6p == 0) {
++tcpstat.tcps_pcbhashmiss;
- in6p = in6_pcblookup_bind(&tcb6, &d, th->th_dport);
+ in6p = in6_pcblookup_bind(&tcb6, &d,
+ th->th_dport, 0);
}
}
#endif
@@ -777,11 +781,24 @@
break;
#if defined(INET6) && !defined(TCP6)
case AF_INET6:
+ {
+ int faith;
+
+#if defined(NFAITH) && NFAITH > 0
+ if (m->m_pkthdr.rcvif
+ && m->m_pkthdr.rcvif->if_type == IFT_FAITH) {
+ faith = 1;
+ } else
+ faith = 0;
+#else
+ faith = 0;
+#endif
in6p = in6_pcblookup_connect(&tcb6, &ip6->ip6_src, th->th_sport,
- &ip6->ip6_dst, th->th_dport);
+ &ip6->ip6_dst, th->th_dport, faith);
if (in6p == NULL) {
++tcpstat.tcps_pcbhashmiss;
- in6p = in6_pcblookup_bind(&tcb6, &ip6->ip6_dst, th->th_dport);
+ in6p = in6_pcblookup_bind(&tcb6, &ip6->ip6_dst,
+ th->th_dport, faith);
}
if (in6p == NULL) {
++tcpstat.tcps_noport;
@@ -794,6 +811,7 @@
}
#endif /*IPSEC*/
break;
+ }
#endif
}
diff -r a25b5a9f49b9 -r 62fd7d673e75 sys/netinet6/in6_pcb.c
--- a/sys/netinet6/in6_pcb.c Sat Jul 17 06:57:59 1999 +0000
+++ b/sys/netinet6/in6_pcb.c Sat Jul 17 07:07:08 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_pcb.c,v 1.7 1999/07/09 22:57:27 thorpej Exp $ */
+/* $NetBSD: in6_pcb.c,v 1.8 1999/07/17 07:07:09 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -95,6 +95,7 @@
#ifdef __NetBSD__
extern struct ifnet loif[NLOOP];
#endif
+#include "faith.h"
#ifdef IPSEC
#include <netinet6/ipsec.h>
@@ -907,15 +908,20 @@
}
struct in6pcb *
-in6_pcblookup_connect(head, faddr6, fport_arg, laddr6, lport_arg)
+in6_pcblookup_connect(head, faddr6, fport_arg, laddr6, lport_arg, faith)
struct in6pcb *head;
struct in6_addr *faddr6, *laddr6;
u_int fport_arg, lport_arg;
+ int faith;
{
struct in6pcb *in6p;
u_short fport = fport_arg, lport = lport_arg;
for (in6p = head->in6p_next; in6p != head; in6p = in6p->in6p_next) {
+#if defined(NFAITH) && NFAITH > 0
+ if (faith && (in6p->in6p_flags & IN6P_FAITH) == 0)
+ continue;
+#endif
/* find exact match on both source and dest */
if (in6p->in6p_fport != fport)
continue;
@@ -935,10 +941,11 @@
}
struct in6pcb *
-in6_pcblookup_bind(head, laddr6, lport_arg)
+in6_pcblookup_bind(head, laddr6, lport_arg, faith)
struct in6pcb *head;
struct in6_addr *laddr6;
u_int lport_arg;
+ int faith;
{
struct in6pcb *in6p, *match;
u_short lport = lport_arg;
@@ -949,6 +956,10 @@
* find destination match. exact match is preferred
* against wildcard match.
*/
+#if defined(NFAITH) && NFAITH > 0
+ if (faith && (in6p->in6p_flags & IN6P_FAITH) == 0)
+ continue;
+#endif
if (in6p->in6p_fport != 0)
continue;
if (in6p->in6p_lport != lport)
diff -r a25b5a9f49b9 -r 62fd7d673e75 sys/netinet6/in6_pcb.h
--- a/sys/netinet6/in6_pcb.h Sat Jul 17 06:57:59 1999 +0000
+++ b/sys/netinet6/in6_pcb.h Sat Jul 17 07:07:08 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: in6_pcb.h,v 1.3 1999/07/03 21:30:18 thorpej Exp $ */
+/* $NetBSD: in6_pcb.h,v 1.4 1999/07/17 07:07:09 itojun Exp $ */
/*
* Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
@@ -169,9 +169,9 @@
extern struct rtentry *
in6_pcbrtentry __P((struct in6pcb *));
extern struct in6pcb *in6_pcblookup_connect __P((struct in6pcb *,
- struct in6_addr *, u_int, struct in6_addr *, u_int));
+ struct in6_addr *, u_int, struct in6_addr *, u_int, int));
extern struct in6pcb *in6_pcblookup_bind __P((struct in6pcb *,
- struct in6_addr *, u_int));
+ struct in6_addr *, u_int, int));
#endif
#endif /* _KERNEL */
Home |
Main Index |
Thread Index |
Old Index