Skip to contentSkip to conversation

Why can't connect TCP connection..

Q Ghacker 1 participant 1 message Dec 7, 2003 netfilter

lore
Share & tools
lore

Ghacker

author
#0 lore raw

First of all.. I'm sorry for reposting message..

But.. please.. who can tell me why... this connection can't connected..

I register two hook function.. hook_local_in(...) and hook_local_out(...)

And write like this...

static unsigned int hook_local_out(......)

{
    if((*pskb)->nh.iph->protocol == IPPROTO_TCP) (*pskb)->nh.iph->protocol = 224;
    return NF_ACCEPT;
}

static unsigned int hook_local_in(......)

{
    if((*pskb)->nh.iph->protocol == IPPROTO_TCP) return NF_DROP;
    if((*pskb)->nh.iph->protocol == 224) (*pskb)->nh.iph->protocol = IPPROTO_TCP;
    return NF_ACCEPT;
}

Then.. I register these functions...to netfilter.. and try to connect localhost by telnet(using "telnet localhost").

This can't be connected...(I don't know why?)

And... each functions are devide into other host.. and try to connect.. like this("connect" is telnet connection)

hook_local_out connect hook_local_in hook_local_in connect hook_local_out

        host               --->             host                             host                <------                host
                            success                                                                      failure

hook_local_in hook_local_out
hook_local_out connect hook_local_in

        host              <--->             host
                             failure

I don't use other tables..

What is the reason that occur this problem? And how can I solve this problem..(Actually I have to connect this..)