lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <020501d2dde2$6f7ee420$4e7cac60$@cmss.chinamobile.com>
Date:   Mon, 5 Jun 2017 17:59:34 +0800
From:   张胜举 <zhangshengju@...s.chinamobile.com>
To:     "'Pravin Shelar'" <pshelar@....org>
Cc:     "'Pravin Shelar'" <pshelar@...ira.com>,
        "'Linux Kernel Network Developers'" <netdev@...r.kernel.org>,
        "'David S. Miller'" <davem@...emloft.net>
Subject: RE: [net-next] openvswitch: add macro MODULE_ALIAS_VPORT_TYPE for vport type alias

> -----Original Message-----
> From: Pravin Shelar [mailto:pshelar@....org]
> Sent: Monday, June 05, 2017 10:30 AM
> To: 张胜举 <zhangshengju@...s.chinamobile.com>
> Cc: Pravin Shelar <pshelar@...ira.com>; Linux Kernel Network Developers
> <netdev@...r.kernel.org>; David S. Miller <davem@...emloft.net>
> Subject: Re: [net-next] openvswitch: add macro
> MODULE_ALIAS_VPORT_TYPE for vport type alias
> 
> On Sun, Jun 4, 2017 at 1:12 AM, 张胜举
> <zhangshengju@...s.chinamobile.com> wrote:
> >> -----Original Message-----
> >> From: Pravin Shelar [mailto:pshelar@....org]
> >> Sent: Sunday, June 04, 2017 1:58 PM
> >> To: Zhang Shengju <zhangshengju@...s.chinamobile.com>
> >> Cc: Pravin Shelar <pshelar@...ira.com>; Linux Kernel Network
> >> Developers <netdev@...r.kernel.org>; David S. Miller
> >> <davem@...emloft.net>
> >> Subject: Re: [net-next] openvswitch: add macro
> >> MODULE_ALIAS_VPORT_TYPE for vport type alias
> >>
> >> On Sat, Jun 3, 2017 at 6:47 AM, Zhang Shengju
> >> <zhangshengju@...s.chinamobile.com> wrote:
> >> > Add a new macro MODULE_ALIAS_VPORT_TYPE to unify and simplify
> the
> >> > declaration of vport type alias, and replace magic numbers with
> >> > symbolic constants.
> >> >
> >> > Signed-off-by: Zhang Shengju <zhangshengju@...s.chinamobile.com>
> >> > ---
> >> >  net/openvswitch/vport-geneve.c | 2 +-
> >> >  net/openvswitch/vport-gre.c    | 2 +-
> >> >  net/openvswitch/vport-vxlan.c  | 2 +-
> >> >  net/openvswitch/vport.h        | 3 +++
> >> >  4 files changed, 6 insertions(+), 3 deletions(-)
> >> >
> >> > diff --git a/net/openvswitch/vport-geneve.c
> >> > b/net/openvswitch/vport-geneve.c index 5aaf3ba..1c068d6 100644
> >> > --- a/net/openvswitch/vport-geneve.c
> >> > +++ b/net/openvswitch/vport-geneve.c
> >> > @@ -141,4 +141,4 @@ static void __exit ovs_geneve_tnl_exit(void)
> >> >
> >> >  MODULE_DESCRIPTION("OVS: Geneve switching port");
> >> > MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-5");
> >> > +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GENEVE);
> >> > diff --git a/net/openvswitch/vport-gre.c
> >> > b/net/openvswitch/vport-gre.c index 0e72d95..48a5852 100644
> >> > --- a/net/openvswitch/vport-gre.c
> >> > +++ b/net/openvswitch/vport-gre.c
> >> > @@ -113,4 +113,4 @@ static void __exit ovs_gre_tnl_exit(void)
> >> >
> >> >  MODULE_DESCRIPTION("OVS: GRE switching port");
> >> > MODULE_LICENSE("GPL"); -MODULE_ALIAS("vport-type-3");
> >> > +MODULE_ALIAS_VPORT_TYPE(OVS_VPORT_TYPE_GRE);
> >>
> >> This is user visible change. For example this is changing the gre
> >> module alias from "vport-type-3" to "vport-type-OVS_VPORT_TYPE_GRE".
> >> This could break userspace application.
> > Hi Shelar,
> > Actually this change does not change module alias name. I use
> > '__stringify' to address this.  Below is my build result:
> > ```
> > [zhangshengju@...mote net-next]$ modinfo net/openvswitch/vport-
> gre.ko
> > filename:       /gitlab/net-next/net/openvswitch/vport-gre.ko
> > alias:          vport-type-3
> > ...
> > ```
> 
> Yes, I expected this. But when I tried modinfo with your patch, I did not see it.
> here is modinfo output from my setup.
> ---8<---
> root@...ntu:/home/pravin/linux/net-next# modinfo
> net/openvswitch/vport-gre.ko
> filename:       /home/pravin/linux/net-next/./net/openvswitch/vport-gre.ko
> alias:          vport-type-OVS_VPORT_TYPE_GRE
> license:        GPL
> description:    OVS: GRE switching port
> srcversion:     AD3B4449820F294E0B5681C
> depends:        openvswitch
> intree:         Y
> vermagic:       4.12.0-rc2+ SMP mod_unload modversions
Oh, I'm sorry. You are right, it seems ' OVS_VPORT_TYPE_GRE' doesn't expand. 
Maybe I can send another version to use magic number, such as:
MODULE_ALIAS_VPORT_TYPE(3);

Is this okay for you?

BRs,
Zhang Shengju.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ