[dvblast-devel] udp: fix /ifaddr= argument parsing

Benjamin Cohen git at videolan.org
Tue Oct 21 13:01:58 CEST 2014


dvblast | branch: master | Benjamin Cohen <bencoh at notk.org> | Tue Oct 21 12:14:11 2014 +0200| [c19e92f520e546f2d5492d51ce11de3b44528ec3] | committer: Christophe Massiot

udp: fix /ifaddr= argument parsing

/ifaddr= option was not parsed properly, resulting
in an invalid address in the case where /ifaddr is
not the last option.

> http://git.videolan.org/gitweb.cgi/dvblast.git/?a=commit;h=c19e92f520e546f2d5492d51ce11de3b44528ec3
---

 udp.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/udp.c b/udp.c
index 3686286..6199277 100644
--- a/udp.c
+++ b/udp.c
@@ -109,8 +109,11 @@ void udp_Open( void )
             i_mtu = strtol( ARG_OPTION("mtu="), NULL, 0 );
         else if ( IS_OPTION("ifindex=") )
             i_if_index = strtol( ARG_OPTION("ifindex="), NULL, 0 );
-        else if ( IS_OPTION("ifaddr=") )
-            i_if_addr = inet_addr( ARG_OPTION("ifaddr=") );
+        else if ( IS_OPTION("ifaddr=") ) {
+            char *option = config_stropt( ARG_OPTION("ifaddr=") );
+            i_if_addr = inet_addr( option );
+            free( option );
+        }
         else if ( IS_OPTION("ifname=") )
         {
             psz_ifname = config_stropt( ARG_OPTION("ifname=") );



More information about the dvblast-devel mailing list