-
-
Save ql-owo-lp/ebe5e292bc8cf3765695112f009fd2dc to your computer and use it in GitHub Desktop.
Track routing decisions made by fib_validate_source
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kprobe:fib_validate_source { | |
$skb = (struct sk_buff*) arg0; | |
@skb[tid] = $skb; | |
@ipheader[tid] = ((struct iphdr *) ($skb->head + $skb->network_header)); | |
} | |
kretprobe:fib_validate_source { | |
$skb = @skb[tid]; | |
$ipheader = @ipheader[tid]; | |
$version = $ipheader->version; | |
// 0xe9051eac is "172.30.5.233" in little-endian byte order. Replace this with an appropriate | |
// value. | |
if ((uint32)$ipheader->daddr == 0xe9051eac) { | |
printf("%dv%d | %s:%s -> %d\n", $ipheader->protocol, $version, | |
ntop($ipheader->saddr), ntop($ipheader->daddr), retval); | |
} | |
delete(@ipheader[tid]); | |
delete(@skb[tid]); | |
} | |
END { | |
clear(@ipheader); | |
clear(@skb); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment