public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: Prasanna S Panchamukhi <prasanna@in.ibm.com>
Cc: linux-kernel@vger.kernel.org, suparna@in.ibm.com
Subject: Re: [4/4] Network packet tracer module using kprobes interface.
Date: 12 Aug 2004 15:20:21 +0200
Date: Thu, 12 Aug 2004 15:20:21 +0200	[thread overview]
Message-ID: <20040812132021.GB39944@muc.de> (raw)
In-Reply-To: <20040812123541.GD2925@in.ibm.com>

> +static char config[256];
> +static unsigned short src_port, tgt_port;
> +module_param_string(netpktlog, config, 256, 0);
> +MODULE_PARM_DESC(netpktlog, " netpktlog=@<source-port>,<target-port>\n");

It would be better to use the new style module_parm here, then 
it could be even modified from sysfs at runtime when you set suitable 
permissions.

> + * with source port. Example insmod netpktlog.ko netpktlog=@62333,
> + * To trace network packets based on target port, insert module with
> + * target port.	Example insmod netpktlog.ko netpktlog=@,254
> + */
> +
> +static void jnetif_rx(struct sk_buff *skb)
> +{
> +	netfilter_ip(skb);

Are you sure this works?  I'm not sure skb->nh.iph is initialized
at this point. At this point you have to skip the ethernet header
yourself.

> +static void j__kfree_skb(struct sk_buff *skb)
> +{
> +	netfilter_ip(skb);

This may have the same problem depending on where it is called from.
Should be unlikely enough though that it could be ignored.

> +	jprobe_return();
> +}
> +
> +static int jnetif_receive_skb(struct sk_buff *skb)
> +{
> +	netfilter_ip(skb);

This function only sets skb->nh.iph
> +#include <net/udp.h>
> +
> +void tcp_send_dupack(struct sock *sk, struct sk_buff *skb);

This shouldn't be needed anymore, no? 

> +
> +static inline void option_setup(char *opt)

[...] Not sure why you made these two functions inline? 

-andi

  reply	other threads:[~2004-08-12 13:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-11 16:22 [4/4] Network packet tracer module using kprobes interface Prasanna S Panchamukhi
2004-08-12 12:35 ` Prasanna S Panchamukhi
2004-08-12 13:20   ` Andi Kleen [this message]
2004-08-16 15:55     ` Prasanna S Panchamukhi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040812132021.GB39944@muc.de \
    --to=ak@muc.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=prasanna@in.ibm.com \
    --cc=suparna@in.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox