net: vxlan: add macro definition for number of IANA VXLAN-GPE port
authorHao Chen <chenhao288@hisilicon.com>
Sat, 27 Nov 2021 09:34:04 +0000 (17:34 +0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 29 Nov 2021 12:19:53 +0000 (12:19 +0000)
Add macro definition for number of IANA VXLAN-GPE port for generic use.

Signed-off-by: Hao Chen <chenhao288@hisilicon.com>
Signed-off-by: Guangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c
include/net/vxlan.h

index fecff0a..359d167 100644 (file)
@@ -3747,7 +3747,7 @@ static int vxlan_config_validate(struct net *src_net, struct vxlan_config *conf,
 
        if (!conf->dst_port) {
                if (conf->flags & VXLAN_F_GPE)
-                       conf->dst_port = htons(4790); /* IANA VXLAN-GPE port */
+                       conf->dst_port = htons(IANA_VXLAN_GPE_UDP_PORT);
                else
                        conf->dst_port = htons(vxlan_port);
        }
index 08537aa..5a934be 100644 (file)
@@ -10,6 +10,7 @@
 #include <net/nexthop.h>
 
 #define IANA_VXLAN_UDP_PORT     4789
+#define IANA_VXLAN_GPE_UDP_PORT 4790
 
 /* VXLAN protocol (RFC 7348) header:
  * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+