summaryrefslogtreecommitdiff
path: root/sys/src/9/ip/il.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2018-07-10 09:11:19 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2018-07-10 09:11:19 +0200
commita8a642920444ec6689ccfae81a1b1e148f75190e (patch)
tree9f333cc94487616ff89011fe8950381e61b3c28f /sys/src/9/ip/il.c
parent9898aafa0c1212b6c4aee99cb6b9f8280e88e5af (diff)
devip: make il connect fail quickly when theres no route
Diffstat (limited to 'sys/src/9/ip/il.c')
-rw-r--r--sys/src/9/ip/il.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sys/src/9/ip/il.c b/sys/src/9/ip/il.c
index 0368da2e2..1ee07e863 100644
--- a/sys/src/9/ip/il.c
+++ b/sys/src/9/ip/il.c
@@ -208,7 +208,7 @@ struct Ilpriv
void ilrcvmsg(Conv*, Block*);
-void ilsendctl(Conv*, Ilhdr*, int, ulong, ulong, int);
+int ilsendctl(Conv*, Ilhdr*, int, ulong, ulong, int);
void ilackq(Ilcb*, Block*);
void ilprocess(Conv*, Ilhdr*, Block*);
void ilpullup(Conv*);
@@ -984,7 +984,7 @@ iloutoforder(Conv *s, Ilhdr *h, Block *bp)
qunlock(&ic->outo);
}
-void
+int
ilsendctl(Conv *ipc, Ilhdr *inih, int type, ulong id, ulong ack, int ilspec)
{
Ilhdr *ih;
@@ -1043,7 +1043,7 @@ if(ipc->p==nil)
iltype[ih->iltype], nhgetl(ih->ilid), nhgetl(ih->ilack),
nhgets(ih->ilsrc), nhgets(ih->ildst));
- ipoput4(ipc->p->f, bp, 0, ttl, tos, ipc);
+ return ipoput4(ipc->p->f, bp, 0, ttl, tos, ipc);
}
void
@@ -1283,7 +1283,8 @@ ilstart(Conv *c, int type, int fasttimeout)
case IL_CONNECT:
ic->state = Ilsyncer;
iphtadd(&ipriv->ht, c);
- ilsendctl(c, nil, Ilsync, ic->start, ic->recvd, 0);
+ if(ilsendctl(c, nil, Ilsync, ic->start, ic->recvd, 0) < 0)
+ ilhangup(c, "no route");
break;
}