Commit b276198a authored by Sam Hocevar's avatar Sam Hocevar

* ./modules/misc/network/ipv4.c: we use INADDR_NONE instead of -1 (an old

    suggestion from lool).
parent 4e7174c1
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* ipv4.c: IPv4 network abstraction layer * ipv4.c: IPv4 network abstraction layer
***************************************************************************** *****************************************************************************
* Copyright (C) 2001, 2002 VideoLAN * Copyright (C) 2001, 2002 VideoLAN
* $Id: ipv4.c,v 1.12 2003/01/09 23:43:07 massiot Exp $ * $Id: ipv4.c,v 1.13 2003/01/23 15:53:10 sam Exp $
* *
* Authors: Christophe Massiot <massiot@via.ecp.fr> * Authors: Christophe Massiot <massiot@via.ecp.fr>
* Mathias Kretschmer <mathias@research.att.com> * Mathias Kretschmer <mathias@research.att.com>
...@@ -67,6 +67,13 @@ ...@@ -67,6 +67,13 @@
#include "network.h" #include "network.h"
#ifndef INADDR_ANY
# define INADDR_ANY 0x00000000
#endif
#ifndef INADDR_NONE
# define INADDR_NONE 0xFFFFFFFF
#endif
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
...@@ -104,7 +111,8 @@ static int BuildAddr( struct sockaddr_in * p_socket, ...@@ -104,7 +111,8 @@ static int BuildAddr( struct sockaddr_in * p_socket,
#ifdef HAVE_ARPA_INET_H #ifdef HAVE_ARPA_INET_H
if( !inet_aton( psz_address, &p_socket->sin_addr ) ) if( !inet_aton( psz_address, &p_socket->sin_addr ) )
#else #else
if( (p_socket->sin_addr.s_addr = inet_addr( psz_address )) == -1 ) p_socket->sin_addr.s_addr = inet_addr( psz_address );
if( p_socket->sin_addr.s_addr == INADDR_NONE )
#endif #endif
{ {
/* We have a fqdn, try to find its address */ /* We have a fqdn, try to find its address */
...@@ -305,7 +313,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket ) ...@@ -305,7 +313,7 @@ static int OpenUDP( vlc_object_t * p_this, network_socket_t * p_socket )
imr.imr_multiaddr.s_addr = inet_addr(psz_bind_addr); imr.imr_multiaddr.s_addr = inet_addr(psz_bind_addr);
#endif #endif
if ( psz_if_addr != NULL && *psz_if_addr if ( psz_if_addr != NULL && *psz_if_addr
&& inet_addr(psz_if_addr) != -1 ) && inet_addr(psz_if_addr) != INADDR_NONE )
{ {
imr.imr_interface.s_addr = inet_addr(psz_if_addr); imr.imr_interface.s_addr = inet_addr(psz_if_addr);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment