From Port and To Port should accept values of 0 when the IP Protocol is "ICMP".
Fixing https://github.com/rackspace/gophercloud/issues/521
diff --git a/openstack/compute/v2/extensions/secgroups/requests.go b/openstack/compute/v2/extensions/secgroups/requests.go
index 4cef480..a7c0a2d 100644
--- a/openstack/compute/v2/extensions/secgroups/requests.go
+++ b/openstack/compute/v2/extensions/secgroups/requests.go
@@ -2,6 +2,7 @@
 
 import (
 	"errors"
+    "strings"
 
 	"github.com/rackspace/gophercloud"
 	"github.com/rackspace/gophercloud/pagination"
@@ -181,10 +182,10 @@
 	if opts.ParentGroupID == "" {
 		return rule, errors.New("A ParentGroupID must be set")
 	}
-	if opts.FromPort == 0 {
+	if opts.FromPort == 0 && strings.ToUpper(opts.IPProtocol) != "ICMP" {
 		return rule, errors.New("A FromPort must be set")
 	}
-	if opts.ToPort == 0 {
+	if opts.ToPort == 0 && strings.ToUpper(opts.IPProtocol) != "ICMP" {
 		return rule, errors.New("A ToPort must be set")
 	}
 	if opts.IPProtocol == "" {