ng_bridge + ng_ksocket

Alexander Motin mav at mavhome.dp.ua
Fri Dec 12 05:38:44 PST 2008


Nikos Vassiliadis wrote:
> On Friday 12 December 2008 10:20:00 Alexander Motin wrote:
>> Five years ago I had the same problem. In result, I have written a small
>> program which monitor interface with libpcap and calls script to
>> reconnect ng_ksocket to the new peer address/port when it changes.
>>
>> The code is old, dirty and was not used for a long time, but if you wish
>> to try that way - it is attached.
> 
> It works, but I don't want go to down that road.
> I was hopping that I was missing something...
> 
> Would you ever consider such a feature, totally unrelated
> to PPP, for mpd?

Feature of what? ksocket is just a building brick, not a complete
end-user solution. It is just a netgraph wrapper around kernel socket
implementation. It may be sufficient for trivial cases, but no more.

UDP socket is connectionless, so it does not handle remote address
change. If it is connected to some remote address/port it just will not
receive any other packet.

You need some daemon to handle any additional logic. One simple example
I have send to you. Another one is MPD, implementing L2TP and
PPP-over-UDP links. Mpd opens separate UDP socket in user-level which
catches everything that wasn't caught by existing connected sockets in
netgraph and dynamically creates and connects additional UDP sockets in
netgraph to handle this traffic.

-- 
Alexander Motin


More information about the freebsd-net mailing list