Netdev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ipmroute: Prevent overlapping storage of `filter` global
@ 2019-06-16 21:46 Michael Forney
  2019-06-18 16:54 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Forney @ 2019-06-16 21:46 UTC (permalink / raw)
  To: netdev

This variable has the same name as `struct xfrm_filter filter` in
ip/ipxfrm.c, but overrides that definition since `struct rtfilter`
is larger.

This is visible when built with -Wl,--warn-common in LDFLAGS:

	/usr/bin/ld: ipxfrm.o: warning: common of `filter' overridden by larger common from ipmroute.o

Signed-off-by: Michael Forney <mforney@mforney.org>
---
I'm not sure if this causes any problems in practice, but it seems
unintended.

 ip/ipmroute.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ip/ipmroute.c b/ip/ipmroute.c
index 8b3c4c25..656ea0dc 100644
--- a/ip/ipmroute.c
+++ b/ip/ipmroute.c
@@ -46,7 +46,7 @@ static void usage(void)
 	exit(-1);
 }
 
-struct rtfilter {
+static struct rtfilter {
 	int tb;
 	int af;
 	int iif;
-- 
2.20.1


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

* Re: [PATCH] ipmroute: Prevent overlapping storage of `filter` global
  2019-06-16 21:46 [PATCH] ipmroute: Prevent overlapping storage of `filter` global Michael Forney
@ 2019-06-18 16:54 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2019-06-18 16:54 UTC (permalink / raw)
  To: Michael Forney; +Cc: netdev

On Sun, 16 Jun 2019 14:46:02 -0700
Michael Forney <mforney@mforney.org> wrote:

> This variable has the same name as `struct xfrm_filter filter` in
> ip/ipxfrm.c, but overrides that definition since `struct rtfilter`
> is larger.
> 
> This is visible when built with -Wl,--warn-common in LDFLAGS:
> 
> 	/usr/bin/ld: ipxfrm.o: warning: common of `filter' overridden by larger common from ipmroute.o
> 
> Signed-off-by: Michael Forney <mforney@mforney.org>

Applied

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-16 21:46 [PATCH] ipmroute: Prevent overlapping storage of `filter` global Michael Forney
2019-06-18 16:54 ` Stephen Hemminger

Netdev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/netdev/0 netdev/git/0.git
	git clone --mirror https://lore.kernel.org/netdev/1 netdev/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 netdev netdev/ https://lore.kernel.org/netdev \
		netdev@vger.kernel.org netdev@archiver.kernel.org
	public-inbox-index netdev


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.netdev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox