Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 16 Dec 2004 09:49:17 +0500
From:      =?ISO-8859-1?B?xOzo8vDo6SDE4u7p7ejq7uI=?= <dvoinikov@kazna.ru>
To:        freebsd-net@freebsd.org
Subject:   Divert sockets no longer behave like connected (SS_ISCONNECTED is removed from so->so_state)
Message-ID:  <1716213283.20041216094917@kazna.ru>

next in thread | raw e-mail | index | archive | help
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/




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