I want to know the value of m flag and o flag of recently received Router Advertisement. From the kernel source code I came to know that m flag and o flag are stored.
/*
* Remember the managed/otherconf flags from most recently
* received RA message (RFC 2462) -- yoshfuji
*/
in6_dev->if_flags = (in6_dev->if_flags & ~(IF_RA_MANAGED |
IF_RA_OTHERCONF)) |
(ra_msg->icmph.icmp6_addrconf_managed ?
IF_RA_MANAGED : 0) |
(ra_msg->icmph.icmp6_addrconf_other ?
IF_RA_OTHERCONF : 0);
.
.
.
Then I believe it must be possible to retrieve those values using ioctl or proc filesystem or any other method. Could anyone please point that way.
At last I found the way. Thanks to Google, Thanks to Shirley Ma. Please get the code from my blog http://kumaran127.blogspot.jp/2013/05/get-m-and-o-flag-of-most-recently.html
I'm pretty sure you won't find this in procfs but you can analyse these packets with radvdump: see http://www.tldp.org/HOWTO/Linux+IPv6-HOWTO/hints-daemons-radvd.html and for reference of how it's implemented: http://svn.dd-wrt.com/browser/src/router/radvd/radvdump.c?rev=11491 .. Here is how they create the icmp6 filter on a raw socket http://svn.dd-wrt.com/browser/src/router/radvd/socket.c?rev=11491 which is then used to listen in on.
Cheers
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With