Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Nov 2004 20:13:53 +0000 (GMT)
From:      Robert Watson <rwatson@freebsd.org>
To:        Archie Cobbs <archie@dellroad.org>
Cc:        net@freebsd.org
Subject:   Re: divert(4) socket isn't connection oriented
Message-ID:  <Pine.NEB.3.96L.1041115201109.66223M-100000@fledge.watson.org>
In-Reply-To: <200411151417.iAFEHfhN015171@arch20m.dellroad.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Mon, 15 Nov 2004, Archie Cobbs wrote:

> Gleb Smirnoff wrote:
> > Since it is working, it was not noticed quickly. Real problems occur when
> > a multicast packet comes on interface: it is diverted to ng_ksocket, returned
> > and div_output() sends it to ip_output(). In ip_output() it is ip_mloopback()ed
> > and if_simloop()ed. A copy of packet enters divert socket, duplicated... a
> > forever loop and total freeze.
> 
> Your fix makes sense, but is it more of a workaround than a proper fix? 
> It seems like the real bug is that divert is promising to write the
> packet as "outgoing" yet the packet loops back as "incoming". Maybe it
> would make more sense to attach a tag to the packet that divert would
> recognize and know to ignore the extra incoming packet. 
> 
> Also, does the same thing happen with broadcast packets? 

I'm not sure I'm so worried about the loopback case -- it strikes me that
in a world with lots of layering, processing, tunneling, you need to be
able to support the packet "coming back" based on topology (i.e., perhap a
source routed packet) if it matches the criteria for diversion.  The
current behavior appears to be an implementation quirk associated with
divert sockets permitting connection without quite having the more common
datagram socket semantics for connection...  I.e., what if I want the same
packet to be diverted again after it's been reinjected?

Robert N M Watson             FreeBSD Core Team, TrustedBSD Projects
robert@fledge.watson.org      Principal Research Scientist, McAfee Research



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.NEB.3.96L.1041115201109.66223M-100000>