Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net: Plan 9 setKeepAlivePeriod bug? #11266

Closed
bradfitz opened this issue Jun 18, 2015 · 2 comments
Closed

net: Plan 9 setKeepAlivePeriod bug? #11266

bradfitz opened this issue Jun 18, 2015 · 2 comments
Assignees
Milestone

Comments

@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Jun 18, 2015

Plan 9's network code in src/net/tcpsockopt_plan9.go contains this questionable piece of code writing to the ctl file:

// Set keep alive period.                                                                                                                  
func setKeepAlivePeriod(fd *netFD, d time.Duration) error {
        cmd := "keepalive " + string(int64(d/time.Millisecond))
        _, e := fd.ctl.WriteAt([]byte(cmd), 0)
        return e
}

Is that really the Plan 9 interface? Or should be it strconv.Itoa instead?

Otherwise it's actually writing something like "keepalive Ϩ" if d is 1 * time.Second.

@bradfitz bradfitz added the OS-Plan9 label Jun 18, 2015
@bradfitz bradfitz added this to the Go1.5Maybe milestone Jun 18, 2015
@0intro

This comment has been minimized.

Copy link
Member

@0intro 0intro commented Jul 2, 2015

Yes, this code is incorrect. The period should be the milliseconds as a string.
This is described in the ip(3) manual. Thanks for noticing.

@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Jul 2, 2015

CL https://golang.org/cl/11860 mentions this issue.

@0intro 0intro self-assigned this Jul 2, 2015
@0intro 0intro closed this in e6a0c21 Jul 15, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jul 16, 2015
@golang golang locked and limited conversation to collaborators Jul 18, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.