devip: cleanup rudp.c

This commit is contained in:
cinap_lenrek 2018-04-22 18:49:01 +02:00
parent 9860172fce
commit dbf13129a7

View file

@ -280,7 +280,7 @@ rudpclose(Conv *c)
/* force out any delayed acks */ /* force out any delayed acks */
ucb = (Rudpcb*)c->ptcl; ucb = (Rudpcb*)c->ptcl;
qlock(ucb); qlock(ucb);
for(r = ucb->r; r; r = r->next){ for(r = ucb->r; r != nil; r = r->next){
if(r->acksent != r->rcvseq) if(r->acksent != r->rcvseq)
relsendack(c, r, 0); relsendack(c, r, 0);
} }
@ -573,13 +573,11 @@ rudpiput(Proto *rudp, Ipifc *ifc, Block *bp)
} }
if(qfull(c->rq)) { if(qfull(c->rq)) {
netlog(f, Logrudp, "rudp: qfull %I.%d -> %I.%d\n", raddr, rport, netlog(f, Logrudp, "rudp: qfull %I.%d -> %I.%d\n",
laddr, lport); raddr, rport, laddr, lport);
freeblist(bp); freeblist(bp);
} else { } else {
if(bp->next) qpass(c->rq, concatblock(bp));
bp = concatblock(bp);
qpass(c->rq, bp);
} }
qunlock(ucb); qunlock(ucb);
} }
@ -638,8 +636,7 @@ rudpadvise(Proto *rudp, Block *bp, char *msg)
pdest = nhgets(h->udpdport); pdest = nhgets(h->udpdport);
/* Look for a connection */ /* Look for a connection */
for(p = rudp->conv; *p; p++) { for(p = rudp->conv; (s = *p) != nil; p++) {
s = *p;
if(s->rport == pdest) if(s->rport == pdest)
if(s->lport == psource) if(s->lport == psource)
if(ipcmp(s->raddr, dest) == 0) if(ipcmp(s->raddr, dest) == 0)