FreeBSD change for openssh

Mike Karels karels at freebsd.org
Fri Dec 17 08:55:35 AEDT 2021


Loganaden Velvindron <loganaden at gmail.com> wrote:

> This looks like a good change to me.

I haven't seen any other comments.  Can you commit this?  If not, what
is the procedure to get it committed?

Thanks,
		Mike

> On Thu, Dec 9, 2021 at 7:23 PM Mike Karels <karels at freebsd.org> wrote:
> >
> > I submitted this proposed change for openssh a while back, designed to
> > reduce embedded knowledge of old Class A/B/C networks and use the system's
> > IN_LOOPBACK macro where it exists.  I received just one comment:
> >
> > Ed Maste <emaste at freebsd.org> wrote:
> > > On Mon, 15 Nov 2021 at 11:51, Mike Karels <karels at freebsd.org> wrote:
> > > >
> > > > +#ifndef IN_LOOPBACK
> > > > +#define IN_LOOPBACK(i)         (((i) & 0xff000000) == 0x7f000000)
> > > > +#endif
> > > ...
> > > >  static int
> > > >  sockaddr_is_local(struct sockaddr *hostaddr)
> > > >  {
> > > >         switch (hostaddr->sa_family) {
> > > >         case AF_INET:
> > > > -               return (ntohl(((struct sockaddr_in *)hostaddr)->
> > > > -                   sin_addr.s_addr) >> 24) == IN_LOOPBACKNET;
> > > > +               return (IN_LOOPBACK(ntohl(((struct sockaddr_in *)hostaddr)->
> > > > +                   sin_addr.s_addr)));
> >
> > > Looks fine to me.
> >
> > > IMO #ifndef is reasonable as it's unlikely that IN_LOOPBACK() would be
> > > implemented as other than a macro anywhere, but could be a full
> > > autoconf check if that's what OpenSSH folks want.
> >
> > Any other comments or suggestions?  Any general thoughts on doing this?
> > I'd like to get it committed if possible.
> >
> > Thanks,
> >                 Mike
> > _______________________________________________
> > openssh-unix-dev mailing list
> > openssh-unix-dev at mindrot.org
> > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev
> _______________________________________________
> openssh-unix-dev mailing list
> openssh-unix-dev at mindrot.org
> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev


More information about the openssh-unix-dev mailing list