[PATCH] vxlan: Wrong type passed to %pIS

Subsystems: networking drivers, the rest

STALE4275d

4 messages, 4 authors, 2015-02-09 · open the first message on its own page

[PATCH] vxlan: Wrong type passed to %pIS

From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date: 2015-02-07 02:17:42

src_ip is a pointer to a union vxlan_addr, one member of which is a
struct sockaddr. Passing a pointer to src_ip is wrong; one should pass
the value of src_ip itself. Since %pIS formally expects something of
type struct sockaddr*, let's pass a pointer to the appropriate union
member, though this of course doesn't change the generated code.

Fixes: e4c7ed415387 ("vxlan: add ipv6 support")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/net/vxlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index a8c755dcab14..11defbb24183 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -991,7 +991,7 @@ static bool vxlan_snoop(struct net_device *dev,
 		if (net_ratelimit())
 			netdev_info(dev,
 				    "%pM migrated from %pIS to %pIS\n",
-				    src_mac, &rdst->remote_ip, &src_ip);
+				    src_mac, &rdst->remote_ip.sa, &src_ip->sa);
 
 		rdst->remote_ip = *src_ip;
 		f->updated = jiffies;
-- 
2.1.3

Re: [PATCH] vxlan: Wrong type passed to %pIS

From: Joe Perches <joe@perches.com>
Date: 2015-02-07 03:35:43

On Sat, 2015-02-07 at 03:17 +0100, Rasmus Villemoes wrote:
src_ip is a pointer to a union vxlan_addr, one member of which is a
struct sockaddr. Passing a pointer to src_ip is wrong; one should pass
the value of src_ip itself. Since %pIS formally expects something of
type struct sockaddr*, let's pass a pointer to the appropriate union
member, though this of course doesn't change the generated code.
Hello Rasmus

Are you finding these mismatches by hand or
are you using some tool?

Re: [PATCH] vxlan: Wrong type passed to %pIS

From: Cong Wang <hidden>
Date: 2015-02-07 05:13:33

On Fri, Feb 6, 2015 at 6:17 PM, Rasmus Villemoes
[off-list ref] wrote:
src_ip is a pointer to a union vxlan_addr, one member of which is a
struct sockaddr. Passing a pointer to src_ip is wrong; one should pass
the value of src_ip itself. Since %pIS formally expects something of
type struct sockaddr*, let's pass a pointer to the appropriate union
member, though this of course doesn't change the generated code.

It is a union, this doesn't harm.
quoted hunk
Fixes: e4c7ed415387 ("vxlan: add ipv6 support")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/net/vxlan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
index a8c755dcab14..11defbb24183 100644
--- a/drivers/net/vxlan.c
+++ b/drivers/net/vxlan.c
@@ -991,7 +991,7 @@ static bool vxlan_snoop(struct net_device *dev,
                if (net_ratelimit())
                        netdev_info(dev,
                                    "%pM migrated from %pIS to %pIS\n",
-                                   src_mac, &rdst->remote_ip, &src_ip);
+                                   src_mac, &rdst->remote_ip.sa, &src_ip->sa);

                rdst->remote_ip = *src_ip;
                f->updated = jiffies;
Since you are on it, there is another similar place in vxlan too.

Re: [PATCH] vxlan: Wrong type passed to %pIS

From: David Miller <davem@davemloft.net>
Date: 2015-02-09 01:15:06

From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Date: Sat,  7 Feb 2015 03:17:31 +0100
src_ip is a pointer to a union vxlan_addr, one member of which is a
struct sockaddr. Passing a pointer to src_ip is wrong; one should pass
the value of src_ip itself. Since %pIS formally expects something of
type struct sockaddr*, let's pass a pointer to the appropriate union
member, though this of course doesn't change the generated code.

Fixes: e4c7ed415387 ("vxlan: add ipv6 support")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Applied, thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help