Fix creation on "dlciX" hook in ng_sample.

Approved by:	julian
MFC after:	3 days
This commit is contained in:
Roman Kurakin 2004-12-23 22:03:32 +00:00
parent 72af302481
commit ff08c098f2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=139249

View File

@ -216,10 +216,11 @@ ng_xxx_newhook(node_p node, hook_p hook, const char *name)
break;
if (chan == XXX_NUM_DLCIS) {
for (chan = 0; chan < XXX_NUM_DLCIS; chan++)
if (xxxp->channel[chan].dlci != -2)
continue;
if (xxxp->channel[chan].dlci == -2)
break;
if (chan == XXX_NUM_DLCIS)
return (ENOBUFS);
xxxp->channel[chan].dlci = dlci;
}
if (xxxp->channel[chan].hook != NULL)
return (EADDRINUSE);