From 0321f208d530087b8bec3bdd974c1ef82887f3f9 Mon Sep 17 00:00:00 2001 From: David Smith Date: Mon, 14 Mar 2011 16:01:46 -0500 Subject: [PATCH] Updated __ip_sock_daddr() for 2.6.38 kernels. * tapset/ip.stp (__ip_sock_daddr): Updated for 2.6.38. --- tapset/ip.stp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tapset/ip.stp b/tapset/ip.stp index 574fc8b9a..04321e12d 100644 --- a/tapset/ip.stp +++ b/tapset/ip.stp @@ -49,11 +49,14 @@ function __ip_sock_saddr:long (sock:long) /* return the destination IP address for a given sock */ function __ip_sock_daddr:long (sock:long) { - return (@defined(@cast(sock, "inet_sock")->inet_daddr) - ? @cast(sock, "inet_sock")->inet_daddr # kernel >= 2.6.33 - : (@defined(@cast(sock, "inet_sock")->daddr) - ? @cast(sock, "inet_sock", "kernel")->daddr # kernel >= 2.6.11 - : @cast(sock, "inet_sock", "kernel")->inet->daddr)) + return (@defined(@cast(sock, "inet_sock")->sk->__sk_common->skc_daddr) + ? # kernel >= 2.6.38 + @cast(sock, "inet_sock")->sk->__sk_common->skc_daddr + : (@defined(@cast(sock, "inet_sock")->inet_daddr) + ? @cast(sock, "inet_sock")->inet_daddr # kernel >= 2.6.33 + : (@defined(@cast(sock, "inet_sock")->daddr) + ? @cast(sock, "inet_sock", "kernel")->daddr # kernel >= 2.6.11 + : @cast(sock, "inet_sock", "kernel")->inet->daddr))) } /* Get the IP header from a sk_buff struct */ -- 2.43.5