10000 fix direct tcp by xiaoxuanzi · Pull Request #53 · fastos/fastsocket · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

8000 fix direct tcp #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion kernel/net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -3502,6 +3502,25 @@ int enable_receive_flow_deliver = 0;
EXPORT_SYMBOL(enable_receive_flow_deliver);

#if 0
struct dst_entry *sk_dst_check_direct_tcp(struct sock *sk, u32 cookie)
{
struct dst_entry *dst = sk->sk_rcv_dst ;

if(dst&&dst->obsolete&&dst->ops->check(dst, cookie)== NULL){

dst_release(dst);
sk->sk_rcv_dst = NULL;

if(dst->ops->check(dst, cookie) == NULL){
FPRINTK("Direct TCP socket 0x%p has dst->ops->check(dst, cookie)== NULL \n", sk);
}

return NULL;
}

return dst;
}

static void netif_direct_tcp(struct sk_buff *skb)
{
if (skb->protocol != htons(ETH_P_IP))
Expand All @@ -3524,7 +3543,7 @@ static void netif_direct_tcp(struct sk_buff *skb)
if (sk) {
if ((sk->sk_state != TCP_TIME_WAIT) && sock_flag(sk, SOCK_DIRECT_TCP)) {
FPRINTK("Skb 0x%p[:%u] hit DIRECT_TCP socket 0x%p[:%u]\n", skb, ntohs(th->dest), sk, inet_sk(sk)->num);
if(sk->sk_rcv_dst) {
if(sk->sk_rcv_dst && sk_dst_check_direct_tcp(sk, 0) != NULL) {
skb_dst_set(skb, sk->sk_rcv_dst);
skb->sock_dst = sk->sk_rcv_dst;
FPRINTK("Direct TCP socket 0x%p has dst record 0x%p[%u]\n", sk, sk->sk_rcv_dst, atomic_read(&sk->sk_rcv_dst->__refcnt));
Expand Down
0