Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Nov 1997 01:01:04 -0500
From:      Feiyi Wang <fwang2@eos.ncsu.edu>
To:        archie@whistle.com
Cc:        questions@FreeBSD.ORG
Subject:   Another divert socket question
Message-ID:  <346A97A0.211F@eos.ncsu.edu>

next in thread | raw e-mail | index | archive | help
Hi, Archie

I have another divert socket question to bother you.

In divert man page, it is said that: "Normally, packets read as incoming
should be written as incoming; similiarly for outgoing packets. When
reading and then writing back packets, passing the same socket address
supplied by recvfrom(2) unmodified to sendto(2) simplifies things".

I am a bit confused here: when I do recvfrom(2), the socket address I am
getting is actually a source (struct socketaddr*), if I pass it
unmodified to sendto(2) as detination, it seems contradict to my usual
sense of "read as incoming, write as incoming".  Am I missing something
here?

I do tried this way, it seemed not work. To make my question clear, here
is what I am trying to do - A routing daemon (gated) is listening proto
89 via "normal raw socket". I first use "ipfw" divert all ip packets
with proto 89 to another port, which got a divert socket binded, after
packet checking ok, I want to re-inject it into the incoming stream
without affecting gated daemon.

Can it be done? Now reading is ok, but when I write back, but gated
daemon seems never receive the packets.

Thanks a lot,

/Feiyi



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?346A97A0.211F>