ÎÒÏëͨ¹ý±à³ÌÀ´¶ÔlinuxϵķÓбí×÷Ð޸ġ£ÔÚÒ»±¾×ÊÁÏÉÏ¿´µ½¶ÔÓÚRT netlink½Ó¿Ú¶øÑÔ£¬À´×ÔλÓÚnet/ipv4/fib_frontend.cµÄº¯Êýinet_rtm_newroute(),inet_rtm_delroute()ºÍinet_dump_fib()¶¼ÔÚλÓÚnet/ipv4/devinet.cÖеıíinet_rtnetlink_table[]Öб»×¢²á¡£ËùÒÔ¿ÉÒÔµ÷ÓÃËüÃÇÀ´Ìí¼Ó¡¢É¾³ý¡¢²é¿´Â·ÓɱíÌõÄ¿²¢´¦ÀíÏàÓ¦µÄÏûÏ¢¡£ÆäÖÐinet_rtm_newroute()º¯ÊýÔ´´úÂëÈçÏ£º
int inet_rtm_newroute(struct sk_buff *skb, struct nlmsghdr* nlh, void *arg)
{
struct fib_table * tb;
struct rtattr **rta = arg;
struct rtmsg *r = NLMSG_DATA(nlh);
if (inet_check_attr(r, rta))
return -EINVAL;
tb = fib_new_table(r->rtm_table);
if (tb)
return tb->tb_insert(tb, r, (struct kern_rta*)rta, nlh, &NETLINK_CB(skb));
return -ENOBUFS;
}ÇëÎÊÄÄλ¸ßÊÖÏêϸ½âÊÍÏÂÕâ¸öº¯Êý¸÷¸ö²ÎÊýµÄÒâÒåÒÔ¼°Õâ¸öº¯ÊýµÄÓ÷¨¡£
ÔÚϲ»Ê¤¸Ð¼¤