Last active
July 23, 2019 04:25
-
-
Save kkumar-fk/f58ad8c7d6c66db1ae01f5daadfad54a to your computer and use it in GitHub Desktop.
code blob
This file contains 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
struct sock *__inet_lookup(tcp_hashinfo, skb, src_addr, src_port, dst_addr, dst_port) | |
{ | |
/* Convert dest_port# from network to host byte order */ | |
u16 hnum = ntohs(dst_port); | |
/* First look for an established socket ... */ | |
sk = __inet_lookup_established(tcp_hashinfo, src_addr, src_port, dst_addr, hnum); | |
if (sk) | |
return sk; | |
/* failing which, look for a LISTEN socket */ | |
return __inet_lookup_listener(tcp_hashinfo, skb, src_addr, src_port, dst_addr, hnum); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment