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

Comments

@bradfitz
Copy link
Contributor

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 this to the Go1.5Maybe milestone Jun 18, 2015
@0intro
Copy link
Member

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
Copy link

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

@0intro 0intro self-assigned this Jul 2, 2015
@0intro 0intro closed this as completed 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
@rsc rsc unassigned 0intro Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants