Refactor places where ng_package_data() failed.
Suggested & reviewed by: archie
This commit is contained in:
parent
d71d4ad24f
commit
c345a44978
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user