[PATCH 1/9] wpa_supplicant: use getaddrinfo() when UDP ctrl interface

Jouni Malinen j
Sun Oct 4 09:00:40 PDT 2015


On Wed, Sep 23, 2015 at 02:04:11PM +0200, Janusz Dziedzic wrote:
> Kill not needed #ifdefs and make code common
> for IPv4/IPv6 when registering UDP server for
> ctrl interface.

> @@ -560,20 +556,6 @@ static void wpa_supplicant_global_ctrl_iface_receive(int sock, void *eloop_ctx,
>  		return;
>  	}
>  
> -#ifndef CONFIG_CTRL_IFACE_UDP_REMOTE
> -	if (from.sin_addr.s_addr != htonl((127 << 24) | 1)) {
> -		/*
> -		 * The OS networking stack is expected to drop this kind of
> -		 * frames since the socket is bound to only localhost address.
> -		 * Just in case, drop the frame if it is coming from any other
> -		 * address.
> -		 */
> -		wpa_printf(MSG_DEBUG, "CTRL: Drop packet from unexpected "
> -			   "source %s", inet_ntoa(from.sin_addr));
> -		return;
> -	}
> -#endif /* CONFIG_CTRL_IFACE_UDP_REMOTE */
> -

Huh? Why was this removed? Same applies for patch 2/9
wpa_supplicant_ctrl_iface_receive() changes.

This can be a critical check on some platforms to protect the interface
from remote connection and as such, it must not be removed without very
good justification and certainly not in a patch that claims to be just
cleanup..

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list