[vlc-commits] [Git][videolan/vlc][master] 2 commits: udp: always set ENOPROTOOPT when the family is unknown in net_SetDSCP()

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Jun 29 14:43:14 UTC 2022



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
8a3a546a by Steve Lhomme at 2022-06-29T14:27:36+00:00
udp: always set ENOPROTOOPT when the family is unknown in net_SetDSCP()

Define the ENOPROTOOPT if it's not set. It should be set on POSIX and Windows
systems.

- - - - -
7cba1630 by Steve Lhomme at 2022-06-29T14:27:36+00:00
dsm: fix inet_ntop() return check

inet_ntop() can return 0, 1 or -1. [1]
What we are checking here is that's it's not a valid IP address, so that the
return value is not 1.

[1] https://linux.die.net/man/3/inet_pton

- - - - -


2 changed files:

- modules/access/dsm/access.c
- src/network/udp.c


Changes:

=====================================
modules/access/dsm/access.c
=====================================
@@ -343,7 +343,7 @@ static int get_address( stream_t *p_access )
     access_sys_t *p_sys = p_access->p_sys;
 
     if( p_sys->url.psz_host != NULL &&
-        !inet_pton( AF_INET, p_sys->url.psz_host, &p_sys->addr ) )
+        inet_pton( AF_INET, p_sys->url.psz_host, &p_sys->addr ) != 1 )
     {
         /* This is not an ip address, let's try netbios/dns resolve */
         struct addrinfo *p_info = NULL;


=====================================
src/network/udp.c
=====================================
@@ -79,6 +79,9 @@
 #ifndef IPPROTO_UDPLITE
 # define IPPROTO_UDPLITE 136 /* IANA */
 #endif
+#ifndef ENOPROTOOPT
+# define ENOPROTOOPT 123
+#endif
 
 #if defined (HAVE_NETINET_UDPLITE_H)
 # include <netinet/udplite.h>
@@ -532,9 +535,7 @@ static int net_SetDSCP( int fd, uint8_t dscp )
             break;
 
         default:
-#ifdef ENOPROTOOPT
             errno = ENOPROTOOPT;
-#endif
             return -1;
     }
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9eabb2821e83037efadb5b53f66d8316cc33ef28...7cba16304dd2fe49e965b75a9ba8cdaa668cb166

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/9eabb2821e83037efadb5b53f66d8316cc33ef28...7cba16304dd2fe49e965b75a9ba8cdaa668cb166
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list