Chinaunix

标题: 最新稳定版本内核3.14中网络子系统改变了好多!? [打印本页]

作者: xlhl3    时间: 2015-05-03 17:21
标题: 最新稳定版本内核3.14中网络子系统改变了好多!?
我的模块在linux-2.6.30系统上都能够成功的编译通过,但是在3.14版本上却无法通过!
查看了下原因:在3.14内核版本的skbuff.h文件中的sk_buff结构体做了改动,
在旧版本中sk_buff结构体中有关于路由的结构体    union {    struct dst_entry  *dst;
                                                                                struct rtable *rtable;
                                                                          };
但在新版本中却没有呀!而我的模块中要用到这结构体,这该怎么改呀?  不知道有人遇到这个问题没?求大神指导呀?
作者: mrpre    时间: 2015-05-03 19:12
编译不过是好事......碰到强转的编译器不报错,就等着panic吧
作者: philarlala    时间: 2015-05-03 19:39
可以看看skb_dst函数的实现,不管怎么改,应该都有对应的成员来记录路由相关的信息的
static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
{
        /* If refdst was not refcounted, check we still are in a
         * rcu_read_lock section
         */
        WARN_ON((skb->_skb_refdst & SKB_DST_NOREF) &&
                !rcu_read_lock_held() &&
                !rcu_read_lock_bh_held());
        return (struct dst_entry *)(skb->_skb_refdst & SKB_DST_PTRMASK);
}
在3.14的内核是用成员_skb_refdst来记录路由信息的,源码那里也有注释说明这个参数的


作者: xlhl3    时间: 2015-05-03 22:27
回复 3# philarlala
嗯嗯, 谢谢你的回复,我再好好看一下3.14内核中关于路由的实现,到时候有问题再来讨论讨论。




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2