diff mbox

[net] vxlan: fix byte order of vxlan-gpe port number

Message ID 1484609878-7288-1-git-send-email-lrichard@redhat.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Lance Richardson Jan. 16, 2017, 11:37 p.m. UTC
vxlan->cfg.dst_port is in network byte order, so an htons()
is needed here. Also reduced comment length to stay closer
to 80 column width (still slightly over, however).

Fixes: e1e5314de08b ("vxlan: implement GPE")
Signed-off-by: Lance Richardson <lrichard@redhat.com>
---
 drivers/net/vxlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jiri Benc Jan. 17, 2017, 10:15 a.m. UTC | #1
On Mon, 16 Jan 2017 18:37:58 -0500, Lance Richardson wrote:
> vxlan->cfg.dst_port is in network byte order, so an htons()
> is needed here. Also reduced comment length to stay closer
> to 80 column width (still slightly over, however).

Ouch. A stupid mistake I made. I think it's still okay to fix this, I'm
not aware of anyone using VXLAN-GPE yet, it's main user is going to be
NSH which is still under development.

Acked-by: Jiri Benc <jbenc@redhat.com>

Please apply also to stable.

Thanks,

 Jiri
David Miller Jan. 17, 2017, 8:24 p.m. UTC | #2
From: Lance Richardson <lrichard@redhat.com>
Date: Mon, 16 Jan 2017 18:37:58 -0500

> vxlan->cfg.dst_port is in network byte order, so an htons()
> is needed here. Also reduced comment length to stay closer
> to 80 column width (still slightly over, however).
> 
> Fixes: e1e5314de08b ("vxlan: implement GPE")
> Signed-off-by: Lance Richardson <lrichard@redhat.com>

Applied and queued up for -stable, thanks.
diff mbox

Patch

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index ca7196c..8a79cfc 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2890,7 +2890,7 @@  static int vxlan_dev_configure(struct net *src_net, struct net_device *dev,
 	memcpy(&vxlan->cfg, conf, sizeof(*conf));
 	if (!vxlan->cfg.dst_port) {
 		if (conf->flags & VXLAN_F_GPE)
-			vxlan->cfg.dst_port = 4790; /* IANA assigned VXLAN-GPE port */
+			vxlan->cfg.dst_port = htons(4790); /* IANA VXLAN-GPE port */
 		else
 			vxlan->cfg.dst_port = default_port;
 	}