Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105815078
D14350.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D14350.diff
View Options
Index: head/stand/libsa/ip.c
===================================================================
--- head/stand/libsa/ip.c
+++ head/stand/libsa/ip.c
@@ -416,8 +416,13 @@
while ((getsecs() - t) < tleft) {
errno = 0;
ret = readipv4(d, pkt, payload, tleft, proto);
+ if (ret >= 0)
+ return (ret);
+ /* Bubble up the error if it wasn't successful */
if (errno != EAGAIN)
- break;
+ return (-1);
}
- return (ret);
+ /* We've exhausted tleft; timeout */
+ errno = ETIMEDOUT;
+ return (-1);
}
Index: head/stand/libsa/net.c
===================================================================
--- head/stand/libsa/net.c
+++ head/stand/libsa/net.c
@@ -118,7 +118,7 @@
/* Try to get a packet and process it. */
cc = (*rproc)(d, pkt, payload, tleft);
/* Return on data, EOF or real error. */
- if (cc != -1 || errno != 0)
+ if (cc != -1 || (errno != 0 && errno != ETIMEDOUT))
return (cc);
/* Timed out or didn't get the packet we're waiting for */
Index: head/stand/libsa/tftp.c
===================================================================
--- head/stand/libsa/tftp.c
+++ head/stand/libsa/tftp.c
@@ -638,14 +638,20 @@
if (cc == -1) {
/* Error on transmit; wait before retrying */
while ((getsecs() - t1) < tleft);
+ t1 = getsecs();
continue;
}
+ t = t1 = getsecs();
recvnext:
+ if ((getsecs() - t) > MAXTMO) {
+ errno = ETIMEDOUT;
+ return -1;
+ }
/* Try to get a packet and process it. */
cc = (*rproc)(h, pkt, payload, tleft, rtype);
/* Return on data, EOF or real error. */
- if (cc != -1 || errno != 0)
+ if (cc != -1 || (errno != 0 && errno != ETIMEDOUT))
return (cc);
if ((getsecs() - t1) < tleft) {
goto recvnext;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Dec 22, 2:40 AM (21 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15550052
Default Alt Text
D14350.diff (1 KB)
Attached To
Mode
D14350: libsa: Fix IP recv timeout
Attached
Detach File
Event Timeline
Log In to Comment