diff options
author | David J. Wilder <wilder@wilder.ibm.com> | 2009-07-20 16:08:42 -0700 |
---|---|---|
committer | David J. Wilder <wilder@wilder.ibm.com> | 2009-07-20 16:08:42 -0700 |
commit | 1c47903b03c678470cf81c3a7d5c3ad95420d569 (patch) | |
tree | 5ca4d591bc62a73f5ffa734b177e18f549fe0779 /tapset/tcpmib.stp | |
parent | c8a44dea9630e500f1eb44cb7934217fb2212f4e (diff) | |
download | systemtap-steved-1c47903b03c678470cf81c3a7d5c3ad95420d569.tar.gz systemtap-steved-1c47903b03c678470cf81c3a7d5c3ad95420d569.tar.xz systemtap-steved-1c47903b03c678470cf81c3a7d5c3ad95420d569.zip |
Fixes for 2.6.31. There are some changes in sk_buff structure those cause
failures of compiling ipmib.stp and tcpmib.stp, rtable and dst fields are
deleted.
Diffstat (limited to 'tapset/tcpmib.stp')
-rw-r--r-- | tapset/tcpmib.stp | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/tapset/tcpmib.stp b/tapset/tcpmib.stp index e3e76900..8b443309 100644 --- a/tapset/tcpmib.stp +++ b/tapset/tcpmib.stp @@ -250,12 +250,36 @@ function _is_reset:long (skb:long) %} function _tcpmib_input_route_type:long (skb:long) +{ +%( kernel_v < "2.6.31" %? + return __tcpmib_input_route_type_old(skb) +%: + return __tcpmib_input_route_type_new(skb) +%) +} + +function __tcpmib_input_route_type_old:long (skb:long) %{ /* pure */ - struct rtable *rt; - struct sk_buff *skb = (struct sk_buff *)(long)THIS->skb; - rt = (struct rtable *)kread(&(skb->rtable)); - THIS->__retvalue = kread(&(rt->rt_type)); - CATCH_DEREF_FAULT(); + struct rtable *rt; + struct sk_buff *skb = (struct sk_buff *)(long)THIS->skb; + rt = (struct rtable *)kread(&(skb->rtable)); + if ( rt ) + THIS->__retvalue = kread(&(rt->rt_type)); + else + THIS->__retvalue = RTN_UNSPEC; + CATCH_DEREF_FAULT(); +%} + +function __tcpmib_input_route_type_new:long (skb:long) +%{ /* pure */ + struct rtable *rt; + struct sk_buff *skb = (struct sk_buff *)(long)THIS->skb; + rt = (struct rtable *)kread(&(skb->_skb_dst)); + if ( rt ) + THIS->__retvalue = kread(&(rt->rt_type)); + else + THIS->__retvalue = RTN_UNSPEC; + CATCH_DEREF_FAULT(); %} /* |