devip: properly initialize the connection ignoreadvice and tos flags

This commit is contained in:
cinap_lenrek 2018-04-10 20:02:03 +02:00
parent 0272fa04fd
commit 829a451c2b
2 changed files with 7 additions and 5 deletions

View file

@ -549,7 +549,7 @@ closeconv(Conv *cv)
}
/* close all incoming calls since no listen will ever happen */
for(nc = cv->incall; nc; nc = cv->incall){
for(nc = cv->incall; nc != nil; nc = cv->incall){
cv->incall = nc->next;
closeconv(nc);
}
@ -561,9 +561,9 @@ closeconv(Conv *cv)
while((mp = cv->multi) != nil)
ipifcremmulti(cv, mp->ma, mp->ia);
cv->r = nil;
cv->rgen = 0;
cv->p->close(cv);
if(cv->p->close != nil)
(*cv->p->close)(cv);
cv->state = Idle;
qunlock(cv);
}
@ -1318,7 +1318,9 @@ retry:
c->lport = 0;
c->rport = 0;
c->restricted = 0;
c->ignoreadvice = 0;
c->ttl = MAXTTL;
c->tos = 0;
qreopen(c->rq);
qreopen(c->wq);
qreopen(c->eq);

View file

@ -181,9 +181,9 @@ struct Conv
Proto* p;
int restricted; /* remote port is restricted */
int ignoreadvice; /* don't terminate connection on icmp errors */
uint ttl; /* max time to live */
uint tos; /* type of service */
int ignoreadvice; /* don't terminate connection on icmp errors */
uchar ipversion;
uchar laddr[IPaddrlen]; /* local IP address */