Re: FreeBSD change for openssh

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On Mon, 15 Nov 2021 at 11:51, Mike Karels <karels@xxxxxxxxxxx> 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.
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux