netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ip_tables.h can't be used in C++ programs.
@ 2010-08-20 18:54 Ben Greear
  2010-08-20 23:17 ` Ben Hutchings
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Greear @ 2010-08-20 18:54 UTC (permalink / raw)
  To: NetDev

This method returns void* but is defined to return
a pointer to struct ipt_entry_target.

This will not compile under g++ (or, I'm unable to figure out
how to make it work w/out editing the header file).

Any reason this shouldn't be changed to:

  return (struct ipt_entry_target*)e + e->target_offset;


/* Helper functions */
static __inline__ struct ipt_entry_target *
ipt_get_target(struct ipt_entry *e)
{
         return (void *)e + e->target_offset;
}


IPv6 has similar issue....

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com


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

end of thread, other threads:[~2010-08-20 23:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-20 18:54 ip_tables.h can't be used in C++ programs Ben Greear
2010-08-20 23:17 ` Ben Hutchings
2010-08-20 23:42   ` Ben Greear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).