devip: do not raise error from ipoput*()

It seems some protocols are unprepared to
deal with ipoput*() raising an error
(thrown from ifc->m->bwrite()).

so catch it and return -1 (no route) instead.
This commit is contained in:
cinap_lenrek 2024-07-28 00:32:14 +00:00
parent 520d698c3e
commit 75ac2674de
2 changed files with 10 additions and 4 deletions

View file

@ -129,10 +129,13 @@ ipoput4(Fs *f, Block *bp, Ipifc *gating, int ttl, int tos, Routehint *rh)
}
if(waserror()){
runlock(ifc);
nexterror();
/* bp is freed by m->bwrite() called from ipifcoput() */
return -1;
}
if(ifc->m == nil || ifc->ifcid != r->ifcid)
if(ifc->m == nil || ifc->ifcid != r->ifcid){
rv = -1;
goto raise;
}
medialen = ifc->maxtu - ifc->m->hsize;
if(gating != nil) {

View file

@ -82,11 +82,14 @@ ipoput6(Fs *f, Block *bp, Ipifc *gating, int ttl, int tos, Routehint *rh)
}
if(waserror()){
runlock(ifc);
nexterror();
/* bp is freed by m->bwrite() called from ipifcoput() */
return -1;
}
if(ifc->m == nil || r->ifcid != ifc->ifcid)
if(ifc->m == nil || r->ifcid != ifc->ifcid){
rv = -1;
goto raise;
}
medialen = ifc->maxtu - ifc->m->hsize;
if(gating != nil){