Divert sockets no longer behave like connected (SS_ISCONNECTED is removed from so->so_state)

Äìèòðèé Äâîéíèêîâ dvoinikov at kazna.ru
Wed Dec 15 20:49:24 PST 2004


Hello,

I'm having this application (VPN daemon) which
uses divert sockets for sending stuff http://www.targeted.org/nest/
It worked fine under 5.3-RELEASE but broke after
recent upgrade to FreeBSD 5.3-STABLE.

An attempt to send() via divert socket now returns
EDESTADDRREQ "Destination address required". Digging
up the CVS revealed this:
http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/netinet/ip_divert.c
Quote:
> Revision 1.98.2.1 / (download) - annotate - [select for diffs], Tue Nov 23 15:30:02 2004 UTC (3 weeks ago) by glebius
> Branch: RELENG_5
> - Since divert protocol is not connection oriented, remove SS_ISCONNECTED flag
>   from divert sockets.

Also relevant is this message by Gleb Smirnoff:
http://www.freebsd.org/cgi/getmsg.cgi?fetch=50544+0+/usr/local/www/db/text/2004/freebsd-net/20041121.freebsd-net
Quote:
> So, the real change suggested is to remove SS_ISCONNECTED from so->so_state. All
> other changes are its logical consequences.
> What was idea of that SS_ISCONNECTED flag always set? I can't find any problems we
> can get by removing this code.

Well, I'm having one - my application stopped working.

Also, quote from man divert:

> Packets are written as either incom-
> ing or outgoing: if write(2) or send(2) is used to deliver the packet
> ... skip ...
> then the packet is treated as if it were outgoing

My case exactly, but this no longer holds.

What am I supposed to do now ? Modify my application ? Actually I already
did that, by switching to sendto(), but just wanted to make sure this
divert sockets semantics change is intented and not spontaneous.

Sincerely,
Dmitry Dvoinikov
http://www.targeted.org/




More information about the freebsd-net mailing list