上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 70 下一页
摘要: 看下以前的文章首先说明一下 Routing与 Neighboring subsystem的关联 1、在路由过程中,需要寻找或创建 struct dst_entry (另一种形式是 struct rtable)。 dst_entry 通过neighbour 域与 struct neighbour 关联 阅读全文
posted @ 2022-03-07 18:48 codestacklinuxer 阅读(130) 评论(0) 推荐(0)
摘要: fib_table_lookup 可以参考:https://blog.csdn.net/shichaog/article/details/44658205 1405 int fib_table_lookup(struct fib_table *tb, const struct flowi4 *flp 阅读全文
posted @ 2022-03-07 12:10 codestacklinuxer 阅读(53) 评论(0) 推荐(0)
摘要: 3.6版本以前的路由缓存 缓存无处不在。现代计算机系统中,Cache是CPU与内存间存在一种容量较小但速度很高的存储器,用来存放CPU刚使用过或最近使用的数据。路由缓存就是基于这种思想的软件实现。内核查询FIB前,固定先查询cache中的记录,如果cache命中(hit),那就直接用就好了,不必查询 阅读全文
posted @ 2022-03-07 10:59 codestacklinuxer 阅读(94) 评论(0) 推荐(0)
摘要: /proc/net/stat/rt_cache /proc/net/rt_acct /proc/net/fib_triestat /proc/net/fib_trie ip route get xxxx(ip 地址) ip route list table (local main xxx) Scop 阅读全文
posted @ 2022-03-07 10:55 codestacklinuxer 阅读(120) 评论(0) 推荐(0)
摘要: 见之前的文章fib数据结构 路由fib创建 当通过netlink,操作类型为RTM_NEWROUTE时,调用inet_rtm_newroute函数添加路由。 功能:a)、将用户空间配置内容传过来 rtm_to_fib_config(保存路由表项的 ip 类型 tos 出接口 网关 metric 目的 阅读全文
posted @ 2022-03-05 12:58 codestacklinuxer 阅读(140) 评论(0) 推荐(0)
摘要: sock结构体中有两个成员缓存路由:sk_rx_dst缓存入口路由,sk_dst_cache缓存出口路由 skb结构体中的_skb_refdst在特定时刻仅缓存一种路由,防止反复查找 skb_dst_set需要在调用前增加引用计数(dst_clone);而skb_dst_set_noref不需要,其 阅读全文
posted @ 2022-03-05 12:58 codestacklinuxer 阅读(212) 评论(0) 推荐(0)
摘要: 规则的添加 在规则初始化时,会注册添加函数fib_nl_newrule rtnl_register(PF_UNSPEC, RTM_NEWRULE, fib_nl_newrule, NULL); 接下来,分析创建规则fib_nl_newrule函数功能: (1)根据应用层传递的协议类型,找到相应的fi 阅读全文
posted @ 2022-03-04 14:48 codestacklinuxer 阅读(74) 评论(0) 推荐(0)
摘要: 全局散列表net->ipv4.fib_table_hash中,存放所有的路由表fib_table; 结构体fib_alias 相同网段的每一条路由表项有各自的fib_alias结构;多个fib_alias可以共享一个fib_info结构; struct fib_alias { struct hlis 阅读全文
posted @ 2022-03-03 17:54 codestacklinuxer 阅读(230) 评论(0) 推荐(0)
摘要: 阅读全文
posted @ 2022-03-03 10:16 codestacklinuxer 阅读(30) 评论(0) 推荐(0)
摘要: 目前有个项目要求 Apache以other的身份模拟root 用户权限来执行! 目前想到的就是 fakeroot 以及S位,在此bing转载了一篇setuid相关博客, 转载自:https://www.hrwhisper.me/introduction-to-linux-capability/ Li 阅读全文
posted @ 2022-03-02 11:54 codestacklinuxer 阅读(77) 评论(0) 推荐(0)
上一页 1 ··· 26 27 28 29 30 31 32 33 34 ··· 70 下一页