--- embedaddon/miniupnpd/linux/getifstats.c	2012/05/29 12:55:57	1.1.1.2
+++ embedaddon/miniupnpd/linux/getifstats.c	2013/07/22 00:32:35	1.1.1.3
@@ -1,7 +1,7 @@
-/* $Id: getifstats.c,v 1.1.1.2 2012/05/29 12:55:57 misho Exp $ */
+/* $Id: getifstats.c,v 1.1.1.3 2013/07/22 00:32:35 misho Exp $ */
 /* MiniUPnP project
  * http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
- * (c) 2006-2011 Thomas Bernard 
+ * (c) 2006-2012 Thomas Bernard
  * This software is subject to the conditions detailed
  * in the LICENCE file provided within the distribution */
 
@@ -91,7 +91,9 @@ getifstats(const char * ifname, struct ifdata * data)
 	f = fopen(fname, "r");
 	if(f) {
 		if(fgets(line, sizeof(line), f)) {
-			data->baudrate = 1000000*atoi(line);
+			i = atoi(line);	/* 65535 means unknown */
+			if(i > 0 && i < 65535)
+				data->baudrate = 1000000*i;
 		}
 		fclose(f);
 	} else {