All of lore.kernel.org
 help / color / mirror / Atom feed
* Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c
@ 2004-01-14 10:34 Emmanuel Guiton
  2004-01-14 11:11 ` Henrik Nordstrom
  0 siblings, 1 reply; 11+ messages in thread
From: Emmanuel Guiton @ 2004-01-14 10:34 UTC (permalink / raw)
  To: netfilter-devel@lists.netfilter.org

Hi!

In the target module I'm writing, I need to customize the values 
ip_ct_tcp_timeout_/somthing/ in the ip_conntrack_proto_tcp.c file. I 
tried to write an extern function on the model of ip_ct_refresh, but I 
always got the same problem with depmod:

depmod: *** Unresolved symbols in 
/lib/modules/2.4.23/kernel/net/ipv4/netfilter/ipt_MY_TARGET.o
depmod:     ip_ct_proto_tcp_set_timeouts

Does someone have a good advice on how to proceed correctly?

                 Emmanuel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c
  2004-01-14 10:34 Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c Emmanuel Guiton
@ 2004-01-14 11:11 ` Henrik Nordstrom
  2004-01-14 12:39   ` Emmanuel Guiton
  0 siblings, 1 reply; 11+ messages in thread
From: Henrik Nordstrom @ 2004-01-14 11:11 UTC (permalink / raw)
  To: Emmanuel Guiton; +Cc: netfilter-devel@lists.netfilter.org

On Wed, 14 Jan 2004, Emmanuel Guiton wrote:

> In the target module I'm writing, I need to customize the values 
> ip_ct_tcp_timeout_/somthing/ in the ip_conntrack_proto_tcp.c file. I 
> tried to write an extern function on the model of ip_ct_refresh, but I 
> always got the same problem with depmod:
> 
> depmod: *** Unresolved symbols in 
> /lib/modules/2.4.23/kernel/net/ipv4/netfilter/ipt_MY_TARGET.o
> depmod:     ip_ct_proto_tcp_set_timeouts
> 
> Does someone have a good advice on how to proceed correctly?

Looks like you have not exported this function from ip_conntrack. To use a 
function from another module than it is defined in the function must first 
be exported from the module where it is defined.

Regards
Henrik

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c
  2004-01-14 11:11 ` Henrik Nordstrom
@ 2004-01-14 12:39   ` Emmanuel Guiton
  2004-01-14 12:50     ` KOVACS Krisztian
  0 siblings, 1 reply; 11+ messages in thread
From: Emmanuel Guiton @ 2004-01-14 12:39 UTC (permalink / raw)
  Cc: netfilter-devel@lists.netfilter.org

Henrik Nordstrom wrote:

>On Wed, 14 Jan 2004, Emmanuel Guiton wrote:
>
>  
>
>>In the target module I'm writing, I need to customize the values 
>>ip_ct_tcp_timeout_/somthing/ in the ip_conntrack_proto_tcp.c file. I 
>>tried to write an extern function on the model of ip_ct_refresh, but I 
>>always got the same problem with depmod:
>>
>>depmod: *** Unresolved symbols in 
>>/lib/modules/2.4.23/kernel/net/ipv4/netfilter/ipt_MY_TARGET.o
>>depmod:     ip_ct_proto_tcp_set_timeouts
>>
>>Does someone have a good advice on how to proceed correctly?
>>    
>>
>
>Looks like you have not exported this function from ip_conntrack. To use a 
>function from another module than it is defined in the function must first 
>be exported from the module where it is defined.
>
>Regards
>Henrik
>  
>

Well, I think I did. I defined my function in the 
ip_conntrack_proto_tcp.c and I exported its prototype in ip_conntrack.h.
Then I call it in my target module which also uses ip_conntrack.h.
Should I have done otherwise?

        Emmanuel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c
  2004-01-14 12:39   ` Emmanuel Guiton
@ 2004-01-14 12:50     ` KOVACS Krisztian
  2004-01-14 13:23       ` Emmanuel Guiton
  0 siblings, 1 reply; 11+ messages in thread
From: KOVACS Krisztian @ 2004-01-14 12:50 UTC (permalink / raw)
  To: emmanuel; +Cc: netfilter-devel


  Hi,

On Wed, 2004-01-14 at 13:39, Emmanuel Guiton wrote:
> >Looks like you have not exported this function from ip_conntrack. To use a 
> >function from another module than it is defined in the function must first 
> >be exported from the module where it is defined.
> 
> Well, I think I did. I defined my function in the 
> ip_conntrack_proto_tcp.c and I exported its prototype in ip_conntrack.h.
> Then I call it in my target module which also uses ip_conntrack.h.

  You have to explicitly export it using the EXPORT_SYMBOL() (or
EXPORT_SYMBOL_GPL) macro in ip_conntrack_standalone.c. It has a lot of
other exported symbols, just add another one.

-- 
 Regards,
   Krisztian KOVACS

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c
  2004-01-14 12:50     ` KOVACS Krisztian
@ 2004-01-14 13:23       ` Emmanuel Guiton
  2004-01-15  8:26         ` Side effect? - " Emmanuel Guiton
  0 siblings, 1 reply; 11+ messages in thread
From: Emmanuel Guiton @ 2004-01-14 13:23 UTC (permalink / raw)
  Cc: netfilter-devel

KOVACS Krisztian wrote:

>  Hi,
>
>On Wed, 2004-01-14 at 13:39, Emmanuel Guiton wrote:
>  
>
>>>Looks like you have not exported this function from ip_conntrack. To use a 
>>>function from another module than it is defined in the function must first 
>>>be exported from the module where it is defined.
>>>      
>>>
>>Well, I think I did. I defined my function in the 
>>ip_conntrack_proto_tcp.c and I exported its prototype in ip_conntrack.h.
>>Then I call it in my target module which also uses ip_conntrack.h.
>>    
>>
>
>  You have to explicitly export it using the EXPORT_SYMBOL() (or
>EXPORT_SYMBOL_GPL) macro in ip_conntrack_standalone.c. It has a lot of
>other exported symbols, just add another one.
>
>  
>
Right, it's working now.
Thanks!

           Emmanuel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Side effect? - Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c
  2004-01-14 13:23       ` Emmanuel Guiton
@ 2004-01-15  8:26         ` Emmanuel Guiton
  2004-01-15 13:14           ` KOVACS Krisztian
  0 siblings, 1 reply; 11+ messages in thread
From: Emmanuel Guiton @ 2004-01-15  8:26 UTC (permalink / raw)
  To: netfilter-devel

Hi!

I was a bit optimistic in my last e-mail. Compilation is totally ok, 
insertion of the modules in the kernel seems to go fine... until I want 
to use them. The nat table does not work anymore.
The ip_tables module seems to be there:
pc104:# iptables -L   
Chain INPUT (policy ACCEPT)
target     prot opt source               destination        

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination        

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination  

But if I try the nat table:
pc104:# iptables -t nat -L
modprobe: Can't locate module ip_tables
iptables v1.2.9: can't initialize iptables table `nat': Table does not 
exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.

If I do not add my function in ip_conntrack_standalone.c, everything's 
ok (well except that I can't use my funciton of course).
To be very precise I just added the following:

In ip_conntrack_standalone.c:
EXPORT_SYMBOL(ip_ct_proto_tcp_set_timeouts);

In ip_conntrack.h:
extern void ip_ct_proto_tcp_set_timeous(/datatypes/);

In ip_conntrack_proto_tcp.c:
void ip_ct_proto_tcp_set_tcp_timeouts(unsigned long new_value, ...)
{
    ...
    ip_ct_tcp_timeout_established = new_value SECS;
    ...
}

And the calls to the function in ipt_MY_TARGET.c:
ip_ct_proto_tcp_set_timeouts(/values/);


What do I do wrong?

           Emmanuel



Emmanuel Guiton wrote:

> KOVACS Krisztian wrote:
>
>>  Hi,
>>
>> On Wed, 2004-01-14 at 13:39, Emmanuel Guiton wrote:
>>  
>>
>>>> Looks like you have not exported this function from ip_conntrack. 
>>>> To use a function from another module than it is defined in the 
>>>> function must first be exported from the module where it is defined.
>>>>     
>>>
>>> Well, I think I did. I defined my function in the 
>>> ip_conntrack_proto_tcp.c and I exported its prototype in 
>>> ip_conntrack.h.
>>> Then I call it in my target module which also uses ip_conntrack.h.
>>>   
>>
>>
>>  You have to explicitly export it using the EXPORT_SYMBOL() (or
>> EXPORT_SYMBOL_GPL) macro in ip_conntrack_standalone.c. It has a lot of
>> other exported symbols, just add another one.
>>
>>  
>>
> Right, it's working now.
> Thanks!
>
>           Emmanuel
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Side effect? - Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c
  2004-01-15  8:26         ` Side effect? - " Emmanuel Guiton
@ 2004-01-15 13:14           ` KOVACS Krisztian
  2004-01-15 13:32             ` Userspace msg, hw_addr unused? Scott MacKay
  2004-01-15 14:19             ` Side effect? - Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c Emmanuel Guiton
  0 siblings, 2 replies; 11+ messages in thread
From: KOVACS Krisztian @ 2004-01-15 13:14 UTC (permalink / raw)
  To: emmanuel; +Cc: netfilter-devel


  Hi,

On Thu, 2004-01-15 at 09:26, Emmanuel Guiton wrote:
> I was a bit optimistic in my last e-mail. Compilation is totally ok, 
> insertion of the modules in the kernel seems to go fine... until I want 
> to use them. The nat table does not work anymore.
> The ip_tables module seems to be there:
> pc104:# iptables -L   
> Chain INPUT (policy ACCEPT)
> target     prot opt source               destination        
> 
> Chain FORWARD (policy ACCEPT)
> target     prot opt source               destination        
> 
> Chain OUTPUT (policy ACCEPT)
> target     prot opt source               destination  
> 
> But if I try the nat table:
> pc104:# iptables -t nat -L
> modprobe: Can't locate module ip_tables
> iptables v1.2.9: can't initialize iptables table `nat': Table does not 
> exist (do you need to insmod?)
> Perhaps iptables or your kernel needs to be upgraded.

  Are you sure iptable_nat is loaded in the kernel? And what does your
kernel log say?

-- 
 Regards,
   Krisztian KOVACS

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Userspace msg, hw_addr unused?
  2004-01-15 13:14           ` KOVACS Krisztian
@ 2004-01-15 13:32             ` Scott MacKay
  2004-01-15 14:00               ` Scott MacKay
  2004-01-15 14:19             ` Side effect? - Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c Emmanuel Guiton
  1 sibling, 1 reply; 11+ messages in thread
From: Scott MacKay @ 2004-01-15 13:32 UTC (permalink / raw)
  To: netfilter-devel

I was looking thru the userspace code for material
passed up in the ipq_packet_msg structure, looking for
any data from the ethernet header.  I noticed that the
hw_addr array never seems to be filled out, even
though hw_addrlen does.  Any reason for that?

Also, if I wanted to patch the kernel's ip_queue.c to
pass up the source and destination ether address, any
ideas on where I get the packet's data from?  Thanks!!

__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Userspace msg, hw_addr unused?
  2004-01-15 13:32             ` Userspace msg, hw_addr unused? Scott MacKay
@ 2004-01-15 14:00               ` Scott MacKay
  0 siblings, 0 replies; 11+ messages in thread
From: Scott MacKay @ 2004-01-15 14:00 UTC (permalink / raw)
  To: netfilter-devel

In poking around, I think I see what would be needed. 
Any confirmation would be great.
entry->skb has a mac.ethernet structure.  This looks
to be a ethhdr, so it has a h_source and h_dest.
2 options seem to be to add a ethdr to the
ipq_packet_msg and memcpy the entry->skb->mac.ethernet
or to add 2 fields (maybe removing the hw_addr if
unused) and memcpy the h_source and h_dest.

I think, if I alter those fields, though, that there
is alot of recompile needed.  Is there a better way to
get to the ethernet fields?


--- Scott MacKay <scottmackay@yahoo.com> wrote:
> I was looking thru the userspace code for material
> passed up in the ipq_packet_msg structure, looking
> for
> any data from the ethernet header.  I noticed that
> the
> hw_addr array never seems to be filled out, even
> though hw_addrlen does.  Any reason for that?
> 
> Also, if I wanted to patch the kernel's ip_queue.c
> to
> pass up the source and destination ether address,
> any
> ideas on where I get the packet's data from? 
> Thanks!!
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Hotjobs: Enter the "Signing Bonus"
> Sweepstakes
> http://hotjobs.sweepstakes.yahoo.com/signingbonus
> 


__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Side effect? - Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c
  2004-01-15 13:14           ` KOVACS Krisztian
  2004-01-15 13:32             ` Userspace msg, hw_addr unused? Scott MacKay
@ 2004-01-15 14:19             ` Emmanuel Guiton
  2004-01-15 14:29               ` Last minute erratum: I'm stupid. - Re: Side effect? - Re: Changing the content of tcp timeouts Emmanuel Guiton
  1 sibling, 1 reply; 11+ messages in thread
From: Emmanuel Guiton @ 2004-01-15 14:19 UTC (permalink / raw)
  Cc: netfilter-devel

KOVACS Krisztian wrote:

>  Are you sure iptable_nat is loaded in the kernel? And what does your
>kernel log say?
>
>  
>
Well, as far as I've modified my sources I can't reproduce the error 
immediately. But a good guess would be that the module was not loaded 
and more specifically the problem may simply occured in the ip_conntrack 
module, thus avoiding iptable_nat to work.
But the problem is now solved. I have not changed anything except the 
name of my function which is much shorter than my original one. Now it's 
working, even the execution produces the result I was expecting. Isn't 
there a specific bound on the function's name? The first name I used was 
44 characters long (it was in fact a longer version of the one I 
indicated in my previous mail).

Tanks for your help anyway.

          Emmanuel

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Last minute erratum: I'm stupid. - Re: Side effect? - Re: Changing the content of tcp timeouts ...
  2004-01-15 14:19             ` Side effect? - Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c Emmanuel Guiton
@ 2004-01-15 14:29               ` Emmanuel Guiton
  0 siblings, 0 replies; 11+ messages in thread
From: Emmanuel Guiton @ 2004-01-15 14:29 UTC (permalink / raw)
  Cc: netfilter-devel

Emmanuel Guiton wrote:

> KOVACS Krisztian wrote:
>
>>  Are you sure iptable_nat is loaded in the kernel? And what does your
>> kernel log say?
>>
>>  
>>
> Well, as far as I've modified my sources I can't reproduce the error 
> immediately. But a good guess would be that the module was not loaded 
> and more specifically the problem may simply occured in the 
> ip_conntrack module, thus avoiding iptable_nat to work.
> But the problem is now solved. I have not changed anything except the 
> name of my function which is much shorter than my original one. Now 
> it's working, even the execution produces the result I was expecting. 
> Isn't there a specific bound on the function's name? The first name I 
> used was 44 characters long (it was in fact a longer version of the 
> one I indicated in my previous mail).
>
> Tanks for your help anyway.
>
>          Emmanuel
>
I just noticed the real cause of the problem. A syntax error in the name 
of my function. I thought I had checked it... Please, forget about all 
the previous messages.
Mea culpa.

           Emmanuel

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2004-01-15 14:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-14 10:34 Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c Emmanuel Guiton
2004-01-14 11:11 ` Henrik Nordstrom
2004-01-14 12:39   ` Emmanuel Guiton
2004-01-14 12:50     ` KOVACS Krisztian
2004-01-14 13:23       ` Emmanuel Guiton
2004-01-15  8:26         ` Side effect? - " Emmanuel Guiton
2004-01-15 13:14           ` KOVACS Krisztian
2004-01-15 13:32             ` Userspace msg, hw_addr unused? Scott MacKay
2004-01-15 14:00               ` Scott MacKay
2004-01-15 14:19             ` Side effect? - Re: Changing the content of tcp timeouts in ip_conntrack_proto_tcp.c Emmanuel Guiton
2004-01-15 14:29               ` Last minute erratum: I'm stupid. - Re: Side effect? - Re: Changing the content of tcp timeouts Emmanuel Guiton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.