------=_NextPart_000_0055_01C751F3.D0CFA380
Content-Type: text/plain;
charset="us-ascii"
Content-Disposition: inline
Hi list,
I am using Linux 2.6.9-42.7.EL kernel, And registering a function in
netfilter like
nf_register_hook( &test ); and test is defined like....
static struct nf_hook_ops test
= { { NULL, NULL }, print_packet, PF_INET, NF_IP_LOCAL_IN, NF_IP_PRI_FILTER
};
print_packet is defined like....
static unsigned int print_packet (unsigned int hook, struct sk_buff **pskb,
const struct net_device *indev, const struct net_device
*outdev,
int (*okfn)(struct sk_buff *) ) {
}
PROBLEM: the registration of the function is successful.....
but I am not getting the local packets(destination ip is my ip) in this hook
function (print_packet).
But I am able to see the packets meant for me in tcpdump and also in my
application running in userspace.
This module works successfully in 2.4 kernel....
Can any one please help me to resolve the problem ?
With Regards,
kanhu
------=_NextPart_000_0055_01C751F3.D0CFA380
Content-Type: text/html;
charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"=
>
<META content=3D"MSHTML 6.00.2800.1586" name=3DGENERATOR></HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>Hi
list,</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>I =
am using
Linux 2.6.9-42.7.EL kernel, And registering a function in netfilter
like</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>nf_regi=
ster_hook(
&test ); and test is defined like....</SPAN></FONT>=
</DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>static s=
truct
nf_hook_ops test<BR>=3D { { NULL, NULL }, print_packet, PF_INET, NF_IP_LO=
CAL_IN,
NF_IP_PRI_FILTER };</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007><SPAN
class=3D221510212-16022007></SPAN></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>print_p=
acket is
defined like....</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>static u=
nsigned int
print_packet (unsigned int hook, struct sk_buff
**pskb,<BR> &n=
bsp;
const struct net_device *indev, const struct net_device
*outdev,<BR> &=
nbsp;
int (*okfn)(struct sk_buff *) ) {</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007>}</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>PROBLEM=
: the
registration of the function is successful.....</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>but I a=
m not getting
the local packets(destination ip is my ip) in this hook function
(print_packet).</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>But I a=
m able to see
the packets meant for me in tcpdump and also in my application runni=
ng in
userspace.</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN class=3D221510212-16022007>This mo=
dule works
successfully in 2.4 kernel....</SPAN></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007></SPAN></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><SPAN
class=3D221510212-16022007></SPAN></FONT> </DIV><FONT size=3D+0><SPA=
N
class=3D221510212-16022007><FONT face=3DArial size=3D2>
<P>Can any one please <SPAN class=3D221510212-16022007>help me to re=
solve the
problem ?</SPAN></P>
<DIV></FONT><FONT face=3DArial size=3D2> With Regards,</FONT></DIV>
<DIV><SPAN class=3D221510212-16022007><FONT face=3DArial
size=3D2>
kanhu</FONT></SPAN></SPAN></FONT></DIV></BODY></HTML>
------=_NextPart_000_0055_01C751F3.D0CFA380--
--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis [at] nl.linux.org
Please read the FAQ at http://kernelnewbies.org/FAQ
