Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: OpenBSD Bridges/VLAN bugs

From: Henric Jungheim <henric(at)attbi.com>
Date: Fri May 23 2003 - 18:20:08 EDT

On Fri, May 23, 2003 at 10:40:44AM -0400, Dave Wintrip wrote:
> Henric Jungheim wrote:

No (pretty sure).

>
> >and B) failing

Do you happen to know if this is an arp or a bridge problem? Which MAC address are the remote hosts using when trying to get to 10.0.0.1? What are the MAC addresses used on the outgoing arp packets (both the actual sender MAC in the header and the MAC address inside the packet proper)? What does the OpenBSD's arp table say? Does this work properly with physical ports instead of vlans?

I suspect that the bridge code may be throwing the packet to the first bridge member interface with a matching MAC address, which may or may not be the one with the IP address. If so, either the bridge code needs to be smarter or the arp code more forgiving...

>
> Yet again- anything I can do to track these problems down, just let me

Even if you're not a C person, you may want to skim through the vlan, arp, and bridge code. You may not "get" it all, but you may be able to see how stuff is getting mangled that way.

Do you need help?X

If you could maintain a summary of what it does vs. what it should do, that could be helpful.

RNF_IGNORE is used in netstat and in the kernel. This should clean up netstat (-current):

Index: usr.bin/netstat/route.c



RCS file: /usr/cvs/src/usr.bin/netstat/route.c,v retrieving revision 1.52
diff -u -r1.52 route.c
--- usr.bin/netstat/route.c	14 May 2003 23:37:05 -0000	1.52
+++ usr.bin/netstat/route.c	23 May 2003 22:16:51 -0000
@@ -328,9 +328,7 @@
 		putchar('R');
 	if (flags & RNF_ACTIVE)
 		putchar('A');
-	if (flags & RNF_IGNORE)
-		putchar('I');
-	if (flags & ~(RNF_NORMAL | RNF_ROOT | RNF_ACTIVE | RNF_IGNORE))
+	if (flags & ~(RNF_NORMAL | RNF_ROOT | RNF_ACTIVE))
 		printf("/0x%02x", flags);
 	putchar('>');

 }

And this should purge the kernel of the RNF_IGNORE code (against -current):

Index: if.c



RCS file: /usr/cvs/src/sys/net/if.c,v
retrieving revision 1.65
diff -u -r1.65 if.c
--- if.c	12 May 2003 00:48:52 -0000	1.65
+++ if.c	23 May 2003 22:10:49 -0000
@@ -112,8 +112,6 @@
 void	if_attachsetup(struct ifnet *);
 void	if_attachdomain1(struct ifnet *);
 int	if_detach_rtdelete(struct radix_node *, void *);
-int	if_mark_ignore(struct radix_node *, void *);
-int	if_mark_unignore(struct radix_node *, void *);
 
 int	ifqmaxlen = IFQ_MAXLEN;
 int	netisr;
@@ -374,34 +372,6 @@
 	return (0);

 }  
-int
-if_mark_ignore(rn, vifp)
-	struct radix_node *rn;
-	void *vifp;
-{
-	struct ifnet *ifp = vifp;
-	struct rtentry *rt = (struct rtentry *)rn;
-
-	if (rt->rt_ifp == ifp)
-		rn->rn_flags |= RNF_IGNORE;
-
-	return (0);
-}
-
-int
-if_mark_unignore(rn, vifp)
-	struct radix_node *rn;
-	void *vifp;
-{
-	struct ifnet *ifp = vifp;
-	struct rtentry *rt = (struct rtentry *)rn;
-
-	if (rt->rt_ifp == ifp)
-		rn->rn_flags &= ~RNF_IGNORE;
-
-	return (0);
-}
-
 /*
  • Detach an interface from everything in the kernel. Also deallocate
  • private resources. @@ -689,8 +659,6 @@ if_down(struct ifnet *ifp) { struct ifaddr *ifa; - struct radix_node_head *rnh; - int i;

         splassert(IPL_SOFTNET);  

@@ -701,16 +669,6 @@

 	}
 	IFQ_PURGE(&ifp->if_snd);
 	rt_ifmsg(ifp);
-
-	/*
-	 * Find and mark as ignore all routes which are using this interface.
-	 * XXX Factor out into a route.c function?
-	 */
-	for (i = 1; i <= AF_MAX; i++) {
-		rnh = rt_tables[i];
-		if (rnh)
-			(*rnh->rnh_walktree)(rnh, if_mark_ignore, ifp);
-	}

 }  

 /*
@@ -724,8 +682,6 @@
 #ifdef notyet

Do you need more help?X

         struct ifaddr *ifa;
 #endif

-	struct radix_node_head *rnh;
-	int i;
 
 	splassert(IPL_SOFTNET);
 

@@ -741,16 +697,6 @@
 #ifdef INET6

         in6_if_up(ifp);
 #endif

-
-	/*
-	 * Find and unignore all routes which are using this interface.
-	 * XXX Factor out into a route.c function?
-	 */
-	for (i = 1; i <= AF_MAX; i++) {
-		rnh = rt_tables[i];
Can we help you?X
- if (rnh) - (*rnh->rnh_walktree)(rnh, if_mark_unignore, ifp); - }

 }  

 /*
Index: radix.c



RCS file: /usr/cvs/src/sys/net/radix.c,v retrieving revision 1.9
diff -u -r1.9 radix.c
--- radix.c	20 Nov 2002 21:21:15 -0000	1.9
+++ radix.c	23 May 2003 22:10:50 -0000
@@ -266,7 +266,7 @@
 	 */
 	if ((saved_t = t)->rn_mask == 0)
 		t = t->rn_dupedkey;
-	for (; t && !(t->rn_flags & RNF_IGNORE); t = t->rn_dupedkey)
+	for (; t; t = t->rn_dupedkey)
 		/*
 		 * Even if we don't match exactly as a host,
 		 * we may match if the leaf we wound up at is
@@ -291,16 +291,14 @@
 			 */
 			do {
 				if (m->rm_flags & RNF_NORMAL) {
-					if (rn_b <= m->rm_b &&
-					    !(m->rm_flags & RNF_IGNORE))
+					if (rn_b <= m->rm_b)
 						return (m->rm_leaf);
 				} else {
 					off = min(t->rn_off, matched_off);
 					x = rn_search_m(v, t, m->rm_mask);
 					while (x && x->rn_mask != m->rm_mask)
 						x = x->rn_dupedkey;
-					if (x && !(x->rn_flags & RNF_IGNORE) &&
-					    rn_satsifies_leaf(v, x, off))
+					if (x && rn_satsifies_leaf(v, x, off))
 						    return x;
 				}
 			} while ((m = m->rm_mklist) != NULL);
Index: radix.h

RCS file: /usr/cvs/src/sys/net/radix.h,v retrieving revision 1.8
diff -u -r1.8 radix.h
--- radix.h	15 Mar 2002 01:20:04 -0000	1.8
+++ radix.h	23 May 2003 22:10:50 -0000
@@ -52,7 +52,6 @@
 #define RNF_NORMAL	1		/* leaf contains normal route */
 #define RNF_ROOT	2		/* leaf is root leaf for tree */
 #define RNF_ACTIVE	4		/* This node is alive (for rtfree) */
-#define RNF_IGNORE	8		/* Ignore this entry (for if down) */
 	union {
 		struct {			/* leaf only data: */
 			caddr_t	rn_Key;		/* object of search */
-- 
henric@attbi.com
http://home.attbi.com/~henric/
Received on Fri May 23 18:25:30 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:57 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library