Project

General

Profile

Bug #9111

libstand: Fix IP recv timeout

Added by Toomas Soome over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
bootloader
Start date:
2018-02-14
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

https://svnweb.freebsd.org/base?view=revision&revision=329264

readip() doesn't, at the moment, properly indicate to callers that it has timed out. One can tell that it's timed out if errno == EAGAIN when it returns, but this is not ideal. Restructure it a little bit to explicitly set errno to ETIMEDOUT if we've exhausted tleft.

I found two places that care about where it timed out or not: sendrecv in net.c and sendrecv_tftp. Both are structured to pass smaller timeout values to readip while tracking a larger timeout. Neither of them were able to do this properly with readip not indicating ETIMEDOUT, so fix it.

While here, straighten out the time (t/t1) usage in sendrecv_tftp.

This would have manifested itself in periodic failures to NFS/TFTP boot for no apparent reason because MINTMO/MAXTMO were not actually being respected properly. Problems were not reported with NFS, only TFTP.

History

#1

Updated by Toomas Soome over 1 year ago

  • Description updated (diff)
#2

Updated by Electric Monk over 1 year ago

  • Status changed from In Progress to Closed
  • % Done changed from 90 to 100

git commit 9a5a2388e3d1f52bed03f56813569786dc86e353

commit  9a5a2388e3d1f52bed03f56813569786dc86e353
Author: Toomas Soome <tsoome@me.com>
Date:   2018-02-15T16:32:32.000Z

    9111 libstand: Fix IP recv timeout
    Reviewed by: Yuri Pankov <yuripv@yuripv.net>
    Reviewed by: Andy Fiddaman <omnios@citrus-it.co.uk>
    Approved by: Dan McDonald <danmcd@joyent.com>

Also available in: Atom PDF