All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] vxlan: Don't set s_addr in vxlan_create_sock
@ 2015-03-13  2:00 Simon Horman
  2015-03-13  3:24 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Horman @ 2015-03-13  2:00 UTC (permalink / raw)
  To: David S. Miller; +Cc: Tom Herbert, netdev, Simon Horman

In the case of AF_INET s_addr was set to INADDR_ANY (0) which which both
symmetric with the AF_INET6 case, where s_addr is not set, and unnecessary
as udp_conf is zeroed out earlier in the same function.

I suspect this change does not have any run-time effect due to compiler
optimisations. But it does make the code a little easier on the/my eyes.

Cc: Tom Herbert <therbert@google.com>
Signed-off-by: Simon Horman <simon.horman@netronome.com>

---
* Found by inspection, lightly tested
---
 drivers/net/vxlan.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index 1e0a775..25d92d4 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -2516,7 +2516,6 @@ static struct socket *vxlan_create_sock(struct net *net, bool ipv6,
 		    !(flags & VXLAN_F_UDP_ZERO_CSUM6_RX);
 	} else {
 		udp_conf.family = AF_INET;
-		udp_conf.local_ip.s_addr = INADDR_ANY;
 	}
 
 	udp_conf.local_udp_port = port;
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] vxlan: Don't set s_addr in vxlan_create_sock
  2015-03-13  2:00 [PATCH net-next] vxlan: Don't set s_addr in vxlan_create_sock Simon Horman
@ 2015-03-13  3:24 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2015-03-13  3:24 UTC (permalink / raw)
  To: simon.horman; +Cc: netdev

From: Simon Horman <simon.horman@netronome.com>
Date: Fri, 13 Mar 2015 11:00:58 +0900

> In the case of AF_INET s_addr was set to INADDR_ANY (0) which which both
> symmetric with the AF_INET6 case, where s_addr is not set, and unnecessary
> as udp_conf is zeroed out earlier in the same function.
> 
> I suspect this change does not have any run-time effect due to compiler
> optimisations. But it does make the code a little easier on the/my eyes.
> 
> Cc: Tom Herbert <therbert@google.com>
> Signed-off-by: Simon Horman <simon.horman@netronome.com>

Seems totally reasonable, applied, thanks Simon.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-13  3:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-13  2:00 [PATCH net-next] vxlan: Don't set s_addr in vxlan_create_sock Simon Horman
2015-03-13  3:24 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.