diff options
author | gVisor bot <gvisor-bot@google.com> | 2019-09-25 20:00:54 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2019-09-25 20:00:54 +0000 |
commit | f6453ac9faefec7798be231b229ab1ac42e0bd64 (patch) | |
tree | 2d2cc25594e54693728eb8ce9129af4af42e5c13 /pkg/tcpip/transport/udp | |
parent | aaf327943e846d7d44a62b79deaacb212f2c8da0 (diff) | |
parent | 59ccbb10446063f5347fb026e35549bc2f677971 (diff) |
Merge release-20190806.1-183-g59ccbb1 (automated)
Diffstat (limited to 'pkg/tcpip/transport/udp')
-rw-r--r-- | pkg/tcpip/transport/udp/protocol.go | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/pkg/tcpip/transport/udp/protocol.go b/pkg/tcpip/transport/udp/protocol.go index 068d9a272..f5cc932dd 100644 --- a/pkg/tcpip/transport/udp/protocol.go +++ b/pkg/tcpip/transport/udp/protocol.go @@ -14,7 +14,7 @@ // Package udp contains the implementation of the UDP transport protocol. To use // it in the networking stack, this package must be added to the project, and -// activated on the stack by passing udp.ProtocolName (or "udp") as one of the +// activated on the stack by passing udp.NewProtocol() as one of the // transport protocols when calling stack.New(). Then endpoints can be created // by passing udp.ProtocolNumber as the transport protocol number when calling // Stack.NewEndpoint(). @@ -30,9 +30,6 @@ import ( ) const ( - // ProtocolName is the string representation of the udp protocol name. - ProtocolName = "udp" - // ProtocolNumber is the udp protocol number. ProtocolNumber = header.UDPProtocolNumber ) @@ -182,8 +179,7 @@ func (p *protocol) Option(option interface{}) *tcpip.Error { return tcpip.ErrUnknownProtocolOption } -func init() { - stack.RegisterTransportProtocolFactory(ProtocolName, func() stack.TransportProtocol { - return &protocol{} - }) +// NewProtocol returns a UDP transport protocol. +func NewProtocol() stack.TransportProtocol { + return &protocol{} } |