[quagga-dev 10012] Set macro NL_PKT_BUF_SIZE to 8192

高鹏 gpstrive at gmail.com
Wed Nov 21 12:58:24 GMT 2012


Hi everyone,
    Recently, I have met a trouble that next hop of the update message sent
from bgpd is ::(all zero) which should be 2001::64/64 . At last , I found
the reason that  buf[4096] or buf[NL_PKT_BUF_SIZE] in function
netlink_parse_info(zebra/rt_netlink.c) was overflow.This
result in zebra can't get the complete interfaces and addresses of the
system.
    I looked into the linux kernel v3.6 and discovered the following
 sections:

"""
     /*
214  *  skb should fit one page. This choice is good for headerless malloc.
215  *  But we should limit to 8K so that userspace does not have to
216  *  use enormous buffer sizes on recvmsg() calls just to avoid
217  *  MSG_TRUNC when PAGE_SIZE is very large.
218  */
219 #if PAGE_SIZE < 8192UL
220 #define NLMSG_GOODSIZE  SKB_WITH_OVERHEAD(PAGE_SIZE)
221 #else
222 #define NLMSG_GOODSIZE  SKB_WITH_OVERHEAD(8192UL)
223 #endif

"""
  PAGE_SIZE on my platform is 64KB, in addtion I had added so many virtual
interfaces.
  I changed buf[4096] to buf[8192], everything is normal.
 So maybe we should be consistent with linux kernel.

-- 
Go ahead!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quagga.net/pipermail/quagga-dev/attachments/20121121/ea25fbac/attachment-0001.html>


More information about the Quagga-dev mailing list