Handle return values of 0 from NgRecvMsg() properly.
This commit is contained in:
parent
321d268b28
commit
1a939a075f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=82277
@ -230,7 +230,7 @@ ether_MessageIn(struct etherdevice *dev)
|
||||
if (ret <= 0)
|
||||
return;
|
||||
|
||||
if (NgRecvMsg(dev->cs, rep, sizeof msgbuf, NULL) < 0)
|
||||
if (NgRecvMsg(dev->cs, rep, sizeof msgbuf, NULL) <= 0)
|
||||
return;
|
||||
|
||||
if (rep->header.version != NG_VERSION) {
|
||||
@ -511,7 +511,7 @@ ether_Create(struct physical *p)
|
||||
|
||||
/* Get our list back */
|
||||
resp = (struct ng_mesg *)rbuf;
|
||||
if (NgRecvMsg(dev->cs, resp, sizeof rbuf, NULL) < 0) {
|
||||
if (NgRecvMsg(dev->cs, resp, sizeof rbuf, NULL) <= 0) {
|
||||
log_Printf(LogWARN, "Cannot get netgraph response: %s\n",
|
||||
strerror(errno));
|
||||
return ether_Abandon(dev, p);
|
||||
|
Loading…
Reference in New Issue
Block a user