summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2018-04-10 20:02:03 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2018-04-10 20:02:03 +0200
commit829a451c2b866d502306bd0b8cbb1991a55faa45 (patch)
tree5b465d69e70218b1b0376b4c1b80c6d6f888cd5c
parent0272fa04fd5da396d5f2b29d8c6c988822d2147b (diff)
downloadplan9front-829a451c2b866d502306bd0b8cbb1991a55faa45.tar.xz
devip: properly initialize the connection ignoreadvice and tos flags
-rw-r--r--sys/src/9/ip/devip.c10
-rw-r--r--sys/src/9/ip/ip.h2
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/src/9/ip/devip.c b/sys/src/9/ip/devip.c
index 6a08a0491..447c1ce68 100644
--- a/sys/src/9/ip/devip.c
+++ b/sys/src/9/ip/devip.c
@@ -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);
diff --git a/sys/src/9/ip/ip.h b/sys/src/9/ip/ip.h
index b7991ebe0..92ed960f1 100644
--- a/sys/src/9/ip/ip.h
+++ b/sys/src/9/ip/ip.h
@@ -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 */