Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where m flag and o flag will be stored in Linux

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.

like image 844
theB Avatar asked May 17 '13 12:05

theB


2 Answers

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

like image 125
theB Avatar answered Nov 13 '22 17:11

theB


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

like image 1
smassey Avatar answered Nov 13 '22 18:11

smassey