[Asterisk-cvs] zaptel zaptel.c,1.89,1.90

markster at lists.digium.com markster at lists.digium.com
Wed Jul 28 17:30:10 CDT 2004


Update of /usr/cvsroot/zaptel
In directory localhost.localdomain:/tmp/cvs-serv20502

Modified Files:
	zaptel.c 
Log Message:
Only use stats if NETHDLC not for PPP


Index: zaptel.c
===================================================================
RCS file: /usr/cvsroot/zaptel/zaptel.c,v
retrieving revision 1.89
retrieving revision 1.90
diff -u -d -r1.89 -r1.90
--- zaptel.c	28 Jul 2004 14:31:31 -0000	1.89
+++ zaptel.c	28 Jul 2004 21:16:14 -0000	1.90
@@ -5506,11 +5506,6 @@
 #if defined(CONFIG_ZAPATA_NET) || defined(CONFIG_ZAPATA_PPP)
 				if (ms->flags & (ZT_FLAG_NETDEV | ZT_FLAG_PPP)) {
 #ifdef CONFIG_ZAPATA_NET
-#ifdef LINUX26
-					struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev);
-#else  /* LINUX26 */
-					struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats;
-#endif /* LINUX26 */
 #endif /* CONFIG_ZAPATA_NET */
 					/* Our network receiver logic is MUCH
 					  different.  We actually only use a single
@@ -5528,14 +5523,27 @@
 							memcpy(skb->data, ms->readbuf[ms->inreadbuf], ms->readn[ms->inreadbuf]);
 							skb_put(skb, ms->readn[ms->inreadbuf]);
 #ifdef CONFIG_ZAPATA_NET
+							if (ms->flags & ZT_FLAG_NETDEV) {
+#ifdef LINUX26
+								struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev);
+#else  /* LINUX26 */
+								struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats;
+#endif /* LINUX26 */
 								stats->rx_packets++;
 								stats->rx_bytes += ms->readn[ms->inreadbuf];
+							}
 #endif
 
 						} else {
 #ifdef CONFIG_ZAPATA_NET
-							if (ms->flags & ZT_FLAG_NETDEV)
+							if (ms->flags & ZT_FLAG_NETDEV) {
+#ifdef LINUX26
+								struct net_device_stats *stats = hdlc_stats(ms->hdlcnetdev->netdev);
+#else  /* LINUX26 */
+								struct net_device_stats *stats = &ms->hdlcnetdev->netdev.stats;
+#endif /* LINUX26 */
 								stats->rx_dropped++;
+							}
 #endif
 #ifdef CONFIG_ZAPATA_PPP
 							if (ms->flags & ZT_FLAG_PPP) {




More information about the svn-commits mailing list