[PATCH] [dvb-apps] dvbnet

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

 



	Hello,

Regarding to previous dvbnet tool retrieve from 
http://www.linuxtv.org/download/dvb/linuxtv-dvb-1.1.1.tar.bz2 tarball, dvbnet 
in actual Mercurial repository doesn't correctly report interface number when 
adding new interface.

See attached patch to fix it.

	Regards,

	Stephane Este-Gracias
# HG changeset patch
# User Stephane Este-Gracias <sestegra@xxxxxxx>
# Node ID 85670e7bdea85da9d44fb30f145f51d6ac0b82b8
# Parent  2265d5d5d989156037e10c3c29cb2dde2661dc6a
Fix interface number report for dvbnet_add_interface

diff -r 2265d5d5d989 -r 85670e7bdea8 lib/libdvbapi/dvbnet.c
--- a/lib/libdvbapi/dvbnet.c	Wed Aug 30 18:01:34 2006 +0200
+++ b/lib/libdvbapi/dvbnet.c	Wed Aug 30 19:28:44 2006 +0200
@@ -44,9 +44,10 @@ int dvbnet_open(int adapter, int netdevi
 	return fd;
 }
 
-int dvbnet_add_interface(int fd, uint16_t pid, enum dvbnet_encap encapsulation)
+int dvbnet_add_interface(int fd, int *ifnum, uint16_t pid, enum dvbnet_encap encapsulation)
 {
 	struct dvb_net_if params;
+	int status;
 
 	memset(&params, 0, sizeof(params));
 	params.pid = pid;
@@ -63,7 +64,11 @@ int dvbnet_add_interface(int fd, uint16_
 	default:
 		return -EINVAL;
 	}
-	return ioctl(fd, NET_ADD_IF, &params);
+
+	status = ioctl(fd, NET_ADD_IF, &params);
+	*ifnum = params.if_num;
+
+	return status;
 }
 
 int dvbnet_get_interface(int fd, int ifnum, uint16_t *pid, enum dvbnet_encap *encapsulation)
diff -r 2265d5d5d989 -r 85670e7bdea8 lib/libdvbapi/dvbnet.h
--- a/lib/libdvbapi/dvbnet.h	Wed Aug 30 18:01:34 2006 +0200
+++ b/lib/libdvbapi/dvbnet.h	Wed Aug 30 19:28:44 2006 +0200
@@ -54,11 +54,12 @@ extern int dvbnet_open(int adapter, int 
  * Create a new DVBNET interface.
  *
  * @param fd FD opened with libdvbnet_open().
+ * @param ifnum Index of added interface.
  * @param pid PID of the stream containing the network data.
  * @param encapsulation Encapsulation type of the stream (one of DVBNET_ENCAP_*).
  * @return 0 on success, nonzero on failure.
  */
-extern int dvbnet_add_interface(int fd, uint16_t pid, enum dvbnet_encap encapsulation);
+extern int dvbnet_add_interface(int fd, int *ifnum, uint16_t pid, enum dvbnet_encap encapsulation);
 
 /**
  * Get details of a DVBNET interface.
diff -r 2265d5d5d989 -r 85670e7bdea8 util/dvbnet/dvbnet.c
--- a/util/dvbnet/dvbnet.c	Wed Aug 30 18:01:34 2006 +0200
+++ b/util/dvbnet/dvbnet.c	Wed Aug 30 19:28:44 2006 +0200
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
 		break;
 
 	case ADD_INTERFACE:
-		if (dvbnet_add_interface(fd_net, pid, encapsulation))
+		if (dvbnet_add_interface(fd_net, &ifnum, pid, encapsulation))
 			fprintf(stderr,
 				"Error: couldn't add interface for pid %d: %d %m.\n",
 				pid, errno);
_______________________________________________
linux-dvb mailing list
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux