Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Khawar Shehzad <shehzad.khawar@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Libmnl - Adding IPv6 Address in the interface
Date: Mon, 29 Aug 2016 13:40:16 +0200	[thread overview]
Message-ID: <20160829114016.GA11200@salvia> (raw)
In-Reply-To: <7bf46bb2-c807-6a3e-3447-60e8b9a8cbf2@gmail.com>

On Mon, Aug 29, 2016 at 07:52:34AM +0100, Khawar Shehzad wrote:
>         ifm = mnl_nlmsg_put_extra_header(nlh, sizeof(*ifm));
> 
>         ifm->ifa_family = AF_INET6;
>         ifm->ifa_prefixlen = 64;
>         ifm->ifa_flags = IFA_F_PERMANENT;
>         ifm->ifa_scope = RT_SCOPE_UNIVERSE;
>         /* TODO get interaface name from user or configuration*/
>         ifm->ifa_index = if_nametoindex("eth0");
>         unsigned char eipn[16];
>         inet_pton(AF_INET6, eip, eipn);

eipn should be 'struct in6_addr' instead.

>         mnl_attr_put(nlh, IFA_ADDRESS, 16,eipn);

So this looks like:

          mnl_attr_put(nlh, IFA_ADDRESS, sizeof(eipn), &eipn);

      reply	other threads:[~2016-08-29 11:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29  6:52 Libmnl - Adding IPv6 Address in the interface Khawar Shehzad
2016-08-29 11:40 ` Pablo Neira Ayuso [this message]

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=20160829114016.GA11200@salvia \
    --to=pablo@netfilter.org \
    --cc=netfilter@vger.kernel.org \
    --cc=shehzad.khawar@gmail.com \
    /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