路由4 【转载: ip_route_output_key函数分析(1) 】
摘要:1 上面的文章读了net/ipv4/route.c 中的ip_route_input函数,是协议站对收到报文的路由查找函数。继续阅读一下协议栈发包的时候路由查找的调用函数ip_roue_output_key。 2 3 int ip_route_output_key(struct net *net, struct rtable **rp, struct flowi *flp) 4...
阅读全文
posted @
2017-05-12 17:02
listenerln
阅读(3126)
推荐(1) 编辑
路由3 【ip_route_input函数分析(2) 】
摘要:1 继续读ip_route_input_slow函数 2 /* 3 * NOTE. We drop all the packets that has local source 4 * addresses, because every properly looped back packet 5 * must have correct destinatio...
阅读全文
posted @
2017-05-12 17:00
listenerln
阅读(1981)
推荐(0) 编辑
路由2 【转载: 再议路由初始化 】
摘要:1 看源代码,发现路由最初初始化的函数在net/ipv4/route.c 2 int __init ip_rt_init(void) 3 { 4 int rc = 0; 5 6 #ifdef CONFIG_NET_CLS_ROUTE 7 ip_rt_acct = __alloc_percpu(256 * sizeof(struct ip_rt_acc...
阅读全文
posted @
2017-05-12 16:57
listenerln
阅读(606)
推荐(0) 编辑
路由1【转载: route 源码分析之路由表初始化 】
摘要:1 开始学习Linux路由。管他对不对先从此函数开始: 2 3 void __init ip_fib_init(void) 4 { 5 /*注册与路由相关的rtnetlink 消息以及他的处理函数,主要处理路由添加删除*/ 6 rtnl_register(PF_INET, RTM_NEWROUTE, inet_rtm_newroute, NULL); ...
阅读全文
posted @
2017-05-12 16:56
listenerln
阅读(1705)
推荐(0) 编辑