emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Fix use of sockaddr_in


From: Lars Ingebrigtsen
Subject: Re: [PATCH] Fix use of sockaddr_in
Date: Sun, 14 May 2017 12:28:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Philipp Stephani <address@hidden> writes:

> +                    case AF_INET:
> +                      port = ((struct sockaddr_in6 *) (struct sockaddr *) 
> &sa1)->sin6_port;
> +                      has_port = true;
> +                      break;
> +                    case AF_INET6:
> +                      port = ((struct sockaddr_in *) (struct sockaddr *) 
> &sa1)->sin_port;
> +                      has_port = true;

Aren't these two cases in reverse?  If it's AF_INET6, it's an in6
struct, not the other way around.

Not that it matters, since (as Eli said) the sizes of the first elements
in the structs are identical...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no



reply via email to

[Prev in Thread] Current Thread [Next in Thread]