netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Greear <greearb@candelatech.com>
To: NetDev <netdev@vger.kernel.org>
Subject: ip_tables.h can't be used in C++ programs.
Date: Fri, 20 Aug 2010 11:54:31 -0700	[thread overview]
Message-ID: <4C6ECF67.3040508@candelatech.com> (raw)

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


             reply	other threads:[~2010-08-20 18:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-20 18:54 Ben Greear [this message]
2010-08-20 23:17 ` ip_tables.h can't be used in C++ programs Ben Hutchings
2010-08-20 23:42   ` Ben Greear

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C6ECF67.3040508@candelatech.com \
    --to=greearb@candelatech.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).