Skip to content

net: WriteMsgUDPAddrPort should accept zero value destination addresses #74841

@database64128

Description

@database64128

Go version

all versions since go1.18

Output of go env in your module/workspace:

see above

What did you do?

Call net.Dialer.DialContext to create a connected *net.UDPConn. Call WriteMsgUDPAddrPort on it with a zero value destination address.

What did you see happen?

WriteMsgUDPAddrPort fails with non-IPv6 address.

What did you expect to see?

WriteMsgUDPAddrPort should allow zero value addresses, just like how WriteMsgUDP allows nil addresses.

WriteMsgUDPAddrPort is used here instead of Write, because we need to send socket control messages together with the payload for UDP GSO.

This should be a straightforward fix. I'm sending a CL.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugReportIssues describing a possible bug in the Go implementation.FixPendingIssues that have a fix which has not yet been reviewed or submitted.NeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions