From: bu.kernel@gmail.com (Bhaskar Upadhyayula)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Questions on Netlink sockets
Date: Tue, 25 Aug 2015 01:47:23 -0700 [thread overview]
Message-ID: <CADmdLE-YPEjC5JoG95jbyNztSoF=YhHC9Eu3JLuEVsqeceNJTA@mail.gmail.com> (raw)
In-Reply-To: <CAKoUArnSUTxWWn79nGN-2Kd4+sx0UM29=eNYRd89HwLhDzDEgA@mail.gmail.com>
Hi Rami,
Sorry for the delay in response.
In the buggy code, the missing lines were the following:
115 data->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)data;
116 linkinfo->rta_len = (void *)NLMSG_TAIL(&req.n) - (void *)linkinfo;
Above code is to adjust the length for nested attributes. I missed it
and the constructed packet was messed up.
'dmesg' was not throwing any errors and I was stuck, trying to debug.
Thx.
On Wed, Aug 19, 2015 at 3:28 AM, Rami Rosen <roszenrami@gmail.com> wrote:
> Hi, Bhaskar,
>
> Thanks for posting the code.
>
>>PS: I am humbled to see a reply from you. I read Chapter 2 from your
>>book to understand netlink sockets.
>
> I hope you enjoyed it and find it useful!
>
>>+ My code is not creating VLAN interface as executed by the 'ip link
>>...' command.
>
> Can you elaborate a bit about this: which difference do you see between creating
> a VLAN with
> ip link add name eth2.200 link eth2 type vlan id 200
>
> And running your program (let's call your executable "vlan_nl")
> in this way:
> ./vlan_nl eth1.100 eth1 100
>
>
>
> Regards,
> Rami Rosen
> http://ramirose.wix.com/ramirosen
prev parent reply other threads:[~2015-08-25 8:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-17 22:55 Questions on Netlink sockets Bhaskar Upadhyayula
2015-08-18 4:18 ` Rami Rosen
2015-08-19 7:07 ` Bhaskar Upadhyayula
2015-08-19 10:28 ` Rami Rosen
2015-08-25 8:47 ` Bhaskar Upadhyayula [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='CADmdLE-YPEjC5JoG95jbyNztSoF=YhHC9Eu3JLuEVsqeceNJTA@mail.gmail.com' \
--to=bu.kernel@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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).