Subject: Re: tcpdrop vs ipv6
To: Christos Zoulas <christos@zoulas.com>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: tech-net
Date: 06/28/2007 20:50:32
This is a multipart MIME message.

--==_Exmh_17773673512720
Content-Type: text/plain; charset=us-ascii


christos@zoulas.com said:
> I will fix the userland portion. Anon Ymous is looking at the scoped
> address issue. 

Fwiw, with the appended patch the "inet" sysctl node can handle both
v4 and v6, and scoped addresses work.

best regards
Matthias



Forschungszentrum Juelich GmbH
52425 Juelich

Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDirig'in Baerbel Brumme-Bothe
Vorstand: Prof. Dr. Achim Bachem (Vorsitzender), Dr. Ulrich Krafft (stellv. 
Vorsitzender)

--==_Exmh_17773673512720
Content-Type: text/plain ; name="drop6.txt"; charset=us-ascii
Content-Description: drop6.txt
Content-Disposition: attachment; filename="drop6.txt"

#
# old_revision [841de7b905d0d47bb9a7a148ff35313f9bee5ad7]
#
# patch "sys/netinet/tcp_usrreq.c"
#  from [f9315a1c738b2d205420f147ff74b60981b208f0]
#    to [973a36227b20663faa28dcac7321115e02cdbdb0]
#
============================================================
--- sys/netinet/tcp_usrreq.c	f9315a1c738b2d205420f147ff74b60981b208f0
+++ sys/netinet/tcp_usrreq.c	973a36227b20663faa28dcac7321115e02cdbdb0
@@ -143,6 +143,7 @@ __KERNEL_RCSID(0, "$NetBSD: tcp_usrreq.c
 #include <netinet/ip6.h>
 #include <netinet6/in6_pcb.h>
 #include <netinet6/ip6_var.h>
+#include <netinet6/scope6_var.h>
 #endif
 
 #include <netinet/tcp.h>
@@ -1314,8 +1315,9 @@ sysctl_net_inet_tcp_ident(SYSCTLFN_ARGS)
 	/*
 	 * requested families must match
 	 */
-	if (pf != sa[0].ss_family || sa[0].ss_family != sa[1].ss_family)
+	if (sa[0].ss_family != sa[1].ss_family)
 		return EINVAL;
+	pf = sa[0].ss_family;
 
 	switch (pf) {
 #ifdef INET
@@ -1341,6 +1343,9 @@ sysctl_net_inet_tcp_ident(SYSCTLFN_ARGS)
 		    si6[0]->sin6_len != si6[1]->sin6_len)
 			return EINVAL;
 
+		sa6_embedscope(si6[0], 1);
+		sa6_embedscope(si6[1], 1);
+
 		s = splsoftnet();
 		error = inet6_ident_core(&si6[0]->sin6_addr, si6[0]->sin6_port,
 		    &si6[1]->sin6_addr, si6[1]->sin6_port,

--==_Exmh_17773673512720--