| To: | Patrick McHardy <kaber@xxxxxxxxx> |
|---|---|
| Subject: | Re: [PATCH 4/6] PKT_SCHED: u32 ematch |
| From: | Thomas Graf <tgraf@xxxxxxx> |
| Date: | Mon, 24 Jan 2005 01:58:53 +0100 |
| Cc: | "David S. Miller" <davem@xxxxxxxxxxxxx>, netdev@xxxxxxxxxxx |
| In-reply-to: | <41F4402D.6040200@trash.net> |
| References: | <20050123230012.GB23931@postel.suug.ch> <20050123230354.GF23931@postel.suug.ch> <41F4402D.6040200@trash.net> |
| Sender: | netdev-bounce@xxxxxxxxxxx |
* Patrick McHardy <41F4402D.6040200@xxxxxxxxx> 2005-01-24 01:24
> Thomas Graf wrote:
> >+static int em_u32_match(struct sk_buff *skb, struct tcf_ematch *em,
> >+ struct tcf_pkt_info *info)
> >+{
> >+ struct tc_u32_key *key = (struct tc_u32_key *) em->data;
> >+ unsigned char *ptr = skb->nh.raw;
> >+
> >+ if (info) {
> >+ if (info->ptr)
> >+ ptr = info->ptr;
> >+ ptr += (info->nexthdr & key->offmask);
> >+ }
> >+
> >+ return !((*(u32*) (ptr + key->off) ^ key->val) & key->mask);
> >
> >
> This needs to make sure it stays inside the skb. I know cls_u32's checks
> are pretty weak, but having nothing doesn't seem right.
It's a exact copy with all the weaknesses inherited. I'll add a
call to tcf_valid_offset, we'll lose the _feature_ to match areas
in the page beyond the skb data though. ;->
|
| Previous by Date: | Re: [PATCH 1/6] PKT_SCHED: Extended Matches API, Patrick McHardy |
|---|---|
| Next by Date: | Re: [PATCH 1/6] PKT_SCHED: Extended Matches API, Thomas Graf |
| Previous by Thread: | Re: [PATCH 4/6] PKT_SCHED: u32 ematch, Patrick McHardy |
| Next by Thread: | [RESEND 4/6] PKT_SCHED: u32 ematch, Thomas Graf |
| Indexes: | [Date] [Thread] [Top] [All Lists] |