On Thu, Dec 11, 2025 at 05:39:33AM +0200, Konstantin Belousov wrote:
> On Thu, Dec 11, 2025 at 02:07:22AM +0000, Gleb Smirnoff wrote:
> > The branch main has been updated by glebius:
> > 
> > URL: 
> > https://cgit.FreeBSD.org/src/commit/?id=e967a2a03677f67d46b458d233a6e93c40d173c9
> > 
> > commit e967a2a03677f67d46b458d233a6e93c40d173c9
> > Author:     Gleb Smirnoff <[email protected]>
> > AuthorDate: 2025-12-11 02:03:35 +0000
> > Commit:     Gleb Smirnoff <[email protected]>
> > CommitDate: 2025-12-11 02:03:35 +0000
> > 
> >     sockets: remove compat shim for divert(4)
> >     
> >     All known software in ports had been addressed three years ago and the
> >     shim stays in stable/14 and stable/15 for another couple years with its
> >     printf(), so all ourliers are expected to conform before 16.0-RELEASE.
> >     See 8624f4347e8133911b0554e816f6bedb56dc5fb3 for details.
> So why breaking the binaries that users might have lingering around?

Aside from that, with a PF_DIVERT socket sd it's not possible to call
sd.recvfrom() in python (because python doesn't know which sockaddr
subtype to use), whereas with a PF_INET divert socket it gives a
sockaddr_in with an interface address, for inbound packets.  So some
applications cannot be quickly repaired.  In fact, I'd find it useful to
go the other way and add support for
socket(PF_INET6, SOCK_RAW, IPPROTO_DIVERT).

> Put this single if() under #ifdef COMPAT15, and perhaps remove the printf()
> as well.
>
> > ---
> >  sys/kern/uipc_socket.c | 11 -----------
> >  1 file changed, 11 deletions(-)
> > 
> > diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
> > index 9eba3ad2e082..8ed5dcc9336a 100644
> > --- a/sys/kern/uipc_socket.c
> > +++ b/sys/kern/uipc_socket.c
> > @@ -913,17 +913,6 @@ socreate(int dom, struct socket **aso, int type, int 
> > proto,
> >     struct socket *so;
> >     int error;
> >  
> > -   /*
> > -    * XXX: divert(4) historically abused PF_INET.  Keep this compatibility
> > -    * shim until all applications have been updated.
> > -    */
> > -   if (__predict_false(dom == PF_INET && type == SOCK_RAW &&
> > -       proto == IPPROTO_DIVERT)) {
> > -           dom = PF_DIVERT;
> > -           printf("%s uses obsolete way to create divert(4) socket\n",
> > -               td->td_proc->p_comm);
> > -   }
> > -
> >     prp = pffindproto(dom, type, proto);
> >     if (prp == NULL) {
> >             /* No support for domain. */
> 

Reply via email to