From 560d156e36d8479d85c22252fe8215dd394a8431 Mon Sep 17 00:00:00 2001 From: Jana Radhakrishnan Date: Mon, 4 May 2015 07:24:11 +0000 Subject: [PATCH] Replaced all proto numbers in netutils with the defined const Signed-off-by: Jana Radhakrishnan --- libnetwork/netutils/utils.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libnetwork/netutils/utils.go b/libnetwork/netutils/utils.go index c448cf24f7..587c86eafa 100644 --- a/libnetwork/netutils/utils.go +++ b/libnetwork/netutils/utils.go @@ -134,11 +134,11 @@ type Protocol uint8 func (p Protocol) String() string { switch p { - case 1: + case ICMP: return "icmp" - case 6: + case TCP: return "tcp" - case 17: + case UDP: return "udp" default: return fmt.Sprintf("%d", p) @@ -149,11 +149,11 @@ func (p Protocol) String() string { func ParseProtocol(s string) Protocol { switch strings.ToLower(s) { case "icmp": - return 1 + return ICMP case "udp": - return 17 + return UDP case "tcp": - return 6 + return TCP default: return 0 }