Skip to content

Instantly share code, notes, and snippets.

@kkumar-fk
Last active July 23, 2019 04:28
Show Gist options
  • Save kkumar-fk/1f9c023dcc1b59563bd98eb9d3cfcfc3 to your computer and use it in GitHub Desktop.
Save kkumar-fk/1f9c023dcc1b59563bd98eb9d3cfcfc3 to your computer and use it in GitHub Desktop.
code chunk
struct sock *__inet_lookup_skb(tcp_hashinfo, skb, src_port, dst_port)
{
/* Get the IPv4 header to know the source and destination IP's */
const struct iphdr *iph = ip_hdr(skb);
/*
* Look up the incoming skb in tcp_hashinfo using the
* [ Source-IP:Port, Destination-IP:Port ] tuple.
*/
return __inet_lookup(tcp_hashinfo, skb, iph->saddr, src_port, iph->daddr, dst_port);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment