<div>Hi</div>  <div>&nbsp;</div>  <div>I am going through the radvd src code. In send.c program, i find the send_ra() fn which creates the various options and sends the ra using sendmsg.</div>  <div>I suppose the msgs are created in the TLV format. I am wondering how the length filed is calculated. For example, while creating the prefix info option, the length field is set to 4 (pinfo-&gt;nd_opt_pi_len = 4;). Can you please let me know how the length field is calculated and how it is 4 for the prefix option</div>  <div>&nbsp;</div>  <div><FONT size=2>while(prefix)</div>  <div>{</div>  <div>dlog(LOG_DEBUG, 3, "Adding prefix on %p", prefix);</div>  <div>if( prefix-&gt;enabled )</div>  <div>{</div>  <div>struct nd_opt_prefix_info *pinfo;</div>  <div></div>  <div>pinfo = (struct nd_opt_prefix_info *) (buff + len);</div>  <div>pinfo-&gt;nd_opt_pi_type = ND_OPT_PREFIX_INFORMATION;</div>  <div>pinfo-&gt;nd_opt_pi_len = 4;</div>  <div>pinfo-&gt;nd_opt_pi_prefix_len =
 prefix-&gt;PrefixLen;</div>  <div></div>  <div>pinfo-&gt;nd_opt_pi_flags_reserved = </div>  <div>(prefix-&gt;AdvOnLinkFlag)?ND_OPT_PI_FLAG_ONLINK:0;</div>  <div>pinfo-&gt;nd_opt_pi_flags_reserved |=</div>  <div>(prefix-&gt;AdvAutonomousFlag)?ND_OPT_PI_FLAG_AUTO:0;</div>  <div>/* Mobile IPv6 ext */</div>  <div>pinfo-&gt;nd_opt_pi_flags_reserved |=</div>  <div>(prefix-&gt;AdvRouterAddr)?ND_OPT_PI_FLAG_RADDR:0;</div>  <div>pinfo-&gt;nd_opt_pi_valid_time = htonl(prefix-&gt;AdvValidLifetime);</div>  <div>pinfo-&gt;nd_opt_pi_preferred_time = htonl(prefix-&gt;AdvPreferredLifetime);</div>  <div>pinfo-&gt;nd_opt_pi_reserved2 = 0;</div>  <div></div>  <div>memcpy(&amp;pinfo-&gt;nd_opt_pi_prefix, &amp;prefix-&gt;Prefix,</div>  <div>sizeof(struct in6_addr));</div>  <div>len += sizeof(*pinfo);</div>  <div>}</div>  <div></FONT>&nbsp;</div>  <div>&nbsp;</div>  <div>Sorry for troubling with a trivial doubt.</div>  <div>&nbsp;</div>  <div>Many thanks</div>  <div>&nbsp;</div>  <div>Magesh</div><p>
                <hr size=1>Yahoo! Mail<br>
Bring photos to life! <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=39174/*http://photomail.mail.yahoo.com">New PhotoMail </a> makes sharing a breeze.