[dpdk-dev] [PATCH v2 5/7] fix the Marco conflict

Wu, Jingjing jingjing.wu at intel.com
Thu Aug 28 05:39:53 CEST 2014


Hi, Thomas

Because these macros such as IPPROTO_TCP, IPPROTO_UDP are already defined in <netinet/in.h>. If user's application include <netinet/in.h> and rte_ip.h at the same time, there will be conflict error, for example cmdline.c in testpmd.
I remember there was someone also raised this issue few month ago.
So just use the way "#ifndef #endif" to avoid the conflict. And it is exactly workaround as you said.

Oh, it should be macro, but not marco, my spelling mistake.
Sorry for that. I will rename this.


> -----Original Message-----
> From: Thomas Monjalon [mailto:thomas.monjalon at 6wind.com]
> Sent: Wednesday, August 27, 2014 10:28 PM
> To: Wu, Jingjing
> Cc: dev at dpdk.org
> Subject: Re: [dpdk-dev] [PATCH v2 5/7] fix the Marco conflict
> 
> 2014-08-27 10:13, Jingjing Wu:
> > fix the Marco conflict between rte_ip.h and netinet/in.h
> 
> Who is Marco?
> 
> > +#ifndef _NETINET_IN_H
> > +#ifndef _NETINET_IN_H_
> >  /* IPv4 protocols */
> >  #define IPPROTO_IP         0  /**< dummy for IP */
> >  #define IPPROTO_HOPOPTS    0  /**< IP6 hop-by-hop options */
> > @@ -226,7 +228,8 @@ struct ipv4_hdr {
> >  #define IPPROTO_DIVERT   254  /**< divert pseudo-protocol */
> >  #define IPPROTO_RAW      255  /**< raw IP packet */
> >  #define IPPROTO_MAX      256  /**< maximum protocol number */
> > -
> > +#endif /* _NETINET_IN_H_ */
> > +#endif /* _NETINET_IN_H */
> 
> Please explain your "fix" (which seems to be a workaround).
> 
> --
> Thomas


More information about the dev mailing list