commit 18730b970da489475cc4c31d3f5b506f21d72fc7
parent 814a61813ffc510f45d71e3b18e89ab7efe5327a
Author: Jesus Galan Lopez (yiyus) <yiyu.jgl@gmail.com>
Date: Tue, 28 Sep 2010 22:18:39 +0200
fix etherx= when x > nve
Diffstat:
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/9vx/etherpcap.c b/src/9vx/etherpcap.c
@@ -158,9 +158,9 @@ pcappnp(Ether* e)
Ctlr c;
static int cve = 0;
- while(cve < nve && ve[cve].tap == 1)
+ while(cve < MaxEther && ve[cve].tap == 1)
cve++;
- if(cve >= nve)
+ if(cve == MaxEther || ve[cve].dev == nil)
return -1;
memset(&c, 0, sizeof(c));
diff --git a/src/9vx/ethertap.c b/src/9vx/ethertap.c
@@ -170,9 +170,9 @@ tappnp(Ether* e)
Ctlr c;
static int cve = 0;
- while(cve < nve && ve[cve].tap == 0)
+ while(cve < MaxEther && ve[cve].tap == 0)
cve++;
- if(cve == nve)
+ if(cve == MaxEther || ve[cve].dev == nil)
return -1;
memset(&c, 0, sizeof c);