[ovs-dev] [PATCH] types: New macros ETH_ADDR_C and ETH_ADDR64_C.

Vishal Deep Ajmera vishal.deep.ajmera at ericsson.com
Thu Nov 30 06:32:06 UTC 2017


Hi Ben,

I faced following error while compiling OVS master on Ubuntu. I am not sure, if I am missing some compiler directive.

./include/openvswitch/types.h:173:41: error: initializer element is not constant
 #define ETH_ADDR_C(A,B,C,D,E,F) (struct eth_addr) \
                                         ^
lib/packets.h:179:7: note: in expansion of macro 'ETH_ADDR_C'
     = ETH_ADDR_C(ff,ff,ff,ff,ff,ff);
       ^

By removing the typecast from types.h file worked.

--old--
#define ETH_ADDR_C(A,B,C,D,E,F) (struct eth_addr) \
     { { .ea = { 0x##A, 0x##B, 0x##C, 0x##D, 0x##E, 0x##F } } }

--new--
#define ETH_ADDR_C(A,B,C,D,E,F) \
     { { .ea = { 0x##A, 0x##B, 0x##C, 0x##D, 0x##E, 0x##F } } }

Warm Regards,
Vishal

-----Original Message-----
From: ovs-dev-bounces at openvswitch.org [mailto:ovs-dev-bounces at openvswitch.org] On Behalf Of Ben Pfaff
Sent: Thursday, November 30, 2017 2:59 AM
To: Mark Michelson <mmichels at redhat.com>
Cc: dev at openvswitch.org
Subject: Re: [ovs-dev] [PATCH] types: New macros ETH_ADDR_C and ETH_ADDR64_C.

On Wed, Nov 29, 2017 at 08:30:07PM +0000, Mark Michelson wrote:
> On Tue, Nov 28, 2017 at 5:33 PM Ben Pfaff <blp at ovn.org> wrote:
> 
> > These macros expand to constants of type struct eth_addr and struct 
> > eth_addr64, respectively, and make it more convenient to initialize 
> > or assign to an Ethernet address object.
> >
> > Signed-off-by: Ben Pfaff <blp at ovn.org>
> >
> 
> Acked-by: Mark Michelson <mmichels at redhat.com>

Thanks, applied to master.
_______________________________________________
dev mailing list
dev at openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


More information about the dev mailing list