public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] question about bridging code.
@ 2003-01-30 15:09 bill guckel
  2003-01-30 15:22 ` [ECOS] " Daniel Néri
  0 siblings, 1 reply; 3+ messages in thread
From: bill guckel @ 2003-01-30 15:09 UTC (permalink / raw)
  To: ecos-discuss

Hello,
I'm hoping someone can answer a question about the function
bridge_input() in net/tcpip/current/src/sys/net/if_bridge.c.
Specifically:
        /*
         * Unicast, make sure it's not for us.
         */
        for (ifl = LIST_FIRST(&sc->sc_iflist);ifl; ifl =
LIST_NEXT(ifl,next)) {
                if (ifl->ifp->if_type != IFT_ETHER)
                        continue;
                ac = (struct arpcom *)ifl->ifp;
                if (bcmp(ac->ac_enaddr, eh->ether_dhost, ETHER_ADDR_LEN) ==
0) {
                        if (ifl->bif_flags & IFBIF_LEARNING)
                                bridge_rtupdate(sc,
                                    (struct ether_addr *)&eh->ether_dhost,
                                    ifp, 0, IFBAF_DYNAMIC);
                        m->m_pkthdr.rcvif = ifl->ifp;
                        return (m);
                }

My question concerns the the passing of 'ether_dhost' to
'bridge_rtupdate()'.
Why not 'ether_shost' ?  This would seem to me (not a bridging expert) be a
more important address to learn.  Note that I may be using old code since
it's been a while since I took new source.

thanks,
bill guckel


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ECOS] Re: question about bridging code.
  2003-01-30 15:09 [ECOS] question about bridging code bill guckel
@ 2003-01-30 15:22 ` Daniel Néri
  2003-01-30 15:48   ` Jonathan Larmour
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Néri @ 2003-01-30 15:22 UTC (permalink / raw)
  To: ecos-discuss

"bill guckel" <bguckel@cisco.com> writes:

> I'm hoping someone can answer a question about the function
> bridge_input() in net/tcpip/current/src/sys/net/if_bridge.c.

[code snipped]

> My question concerns the the passing of 'ether_dhost' to
> 'bridge_rtupdate()'.  Why not 'ether_shost' ?  This would seem to me
> (not a bridging expert) be a more important address to learn.

It seems you are right.

> Note that I may be using old code since it's been a while since I
> took new source.

As far as I can see, this bug still exists in recent source. Though it
was fixed in the original code two years ago:

   http://www.openbsd.org/cgi-bin/cvsweb/src/sys/net/if_bridge.c.diff?r1=1.48&r2=1.49&f=h


Regards,

-- 
Daniel Néri, Sigicom AB, Sweden


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] Re: question about bridging code.
  2003-01-30 15:22 ` [ECOS] " Daniel Néri
@ 2003-01-30 15:48   ` Jonathan Larmour
  0 siblings, 0 replies; 3+ messages in thread
From: Jonathan Larmour @ 2003-01-30 15:48 UTC (permalink / raw)
  To: Daniel Néri; +Cc: ecos-discuss, eCos Patches List

Daniel Néri wrote:
> 
> As far as I can see, this bug still exists in recent source. Though it
> was fixed in the original code two years ago:
> 
>    http://www.openbsd.org/cgi-bin/cvsweb/src/sys/net/if_bridge.c.diff?r1=1.48&r2=1.49&f=h

I've made this change.

Hm.. it seems the bridge stuff isn't in the FreeBSD stack. That would be 
something that needs to be added before we could ever drop the old stack :-|.

Jifl

Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/tcpip/current/ChangeLog,v
retrieving revision 1.41
diff -u -5 -p -r1.41 ChangeLog
--- ChangeLog	22 Dec 2002 11:03:52 -0000	1.41
+++ ChangeLog	30 Jan 2003 15:36:52 -0000
@@ -1,5 +1,11 @@
+2003-01-30  Jonathan Larmour  <jifl@eCosCentric.com>
+
+	* src/sys/net/if_bridge.c (bridge_input): Learn source host addr,
+	not dest host addr.
+	Fix pointed to by Daniel Néri.
+
  2002-12-14  Nick Garnett  <nickg@ecoscentric.com>

  	* src/sys/netinet/tcp_usrreq.c (tcp_usrreq): Rearranged ifndef on
  	PRU_SENSE case to keep the case in the switch and let it return a
  	sensible result. Otherwise a stat() on a socket causes a panic().
Index: src/sys/net/if_bridge.c
===================================================================
RCS file: /cvs/ecos/ecos-opt/net/net/tcpip/current/src/sys/net/if_bridge.c,v
retrieving revision 1.8
diff -u -5 -p -r1.8 if_bridge.c
--- src/sys/net/if_bridge.c	20 May 2002 22:25:20 -0000	1.8
+++ src/sys/net/if_bridge.c	30 Jan 2003 15:36:54 -0000
@@ -1168,11 +1168,11 @@ bridge_input(ifp, eh, m)
  			continue;
  		ac = (struct arpcom *)ifl->ifp;
  		if (bcmp(ac->ac_enaddr, eh->ether_dhost, ETHER_ADDR_LEN) == 0) {
  			if (ifl->bif_flags & IFBIF_LEARNING)
  				bridge_rtupdate(sc,
-				    (struct ether_addr *)&eh->ether_dhost,
+				    (struct ether_addr *)&eh->ether_shost,
  				    ifp, 0, IFBAF_DYNAMIC);
  			m->m_pkthdr.rcvif = ifl->ifp;
  			return (m);
  		}
  		if (bcmp(ac->ac_enaddr, eh->ether_shost, ETHER_ADDR_LEN) == 0) {

-- 
eCosCentric       http://www.eCosCentric.com/       <info@eCosCentric.com>
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-01-30 15:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-30 15:09 [ECOS] question about bridging code bill guckel
2003-01-30 15:22 ` [ECOS] " Daniel Néri
2003-01-30 15:48   ` Jonathan Larmour

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).