Refactor places where ng_package_data() failed.

Suggested & reviewed by:	archie
This commit is contained in:
glebius 2005-05-16 19:12:57 +00:00
parent 8003014f21
commit 27540c786b

View File

@ -1319,18 +1319,17 @@ ng_ppp_frag_process(node_p node)
/* Deliver any deliverable packets */
while (ng_ppp_check_packet(node)) {
ng_ppp_get_packet(node, &m);
if ((item = ng_package_data(m, NG_NOFLAGS)) == NULL)
return (ENOMEM);
ng_ppp_input(node, 0, NG_PPP_BUNDLE_LINKNUM, item);
if ((item = ng_package_data(m, NG_NOFLAGS)) != NULL)
ng_ppp_input(node, 0, NG_PPP_BUNDLE_LINKNUM, item);
}
/* Delete dead fragments and try again */
if (ng_ppp_frag_trim(node)) {
while (ng_ppp_check_packet(node)) {
ng_ppp_get_packet(node, &m);
if ((item = ng_package_data(m, NG_NOFLAGS)) == NULL)
return (ENOMEM);
ng_ppp_input(node, 0, NG_PPP_BUNDLE_LINKNUM, item);
if ((item = ng_package_data(m, NG_NOFLAGS)) != NULL)
ng_ppp_input(node, 0, NG_PPP_BUNDLE_LINKNUM,
item);
}
}
@ -1600,13 +1599,14 @@ ng_ppp_mp_output(node_p node, struct mbuf *m)
}
/* Send fragment */
if ((item = ng_package_data(m2, NG_NOFLAGS)) == NULL)
return (ENOMEM);
error = ng_ppp_output(node, 0, PROT_MP, linkNum, item);
if (error != 0) {
if (!lastFragment)
NG_FREE_M(m);
return (error);
if ((item = ng_package_data(m2, NG_NOFLAGS)) != NULL) {
error = ng_ppp_output(node, 0, PROT_MP,
linkNum, item);
if (error != 0) {
if (!lastFragment)
NG_FREE_M(m);
return (error);
}
}
}
}