Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 90607
b: refs/heads/master
c: 4738c1d
h: refs/heads/master
i:
  90605: 0f83558
  90603: aedd3e8
  90599: 1ad0847
  90591: 6f7f08a
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Apr 10, 2008
1 parent 5ae3e41 commit 370b245
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3cccd6078413e9707f0ef3652b4e6e9cb84e9fa0
refs/heads/master: 4738c1db1593687713869fa69e733eebc7b0d6d8
3 changes: 2 additions & 1 deletion trunk/include/linux/filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */
#define SKF_AD_PROTOCOL 0
#define SKF_AD_PKTTYPE 4
#define SKF_AD_IFINDEX 8
#define SKF_AD_MAX 12
#define SKF_AD_NLATTR 12
#define SKF_AD_MAX 16
#define SKF_NET_OFF (-0x100000)
#define SKF_LL_OFF (-0x200000)

Expand Down
17 changes: 17 additions & 0 deletions trunk/net/core/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include <linux/if_packet.h>
#include <net/ip.h>
#include <net/protocol.h>
#include <net/netlink.h>
#include <linux/skbuff.h>
#include <net/sock.h>
#include <linux/errno.h>
Expand Down Expand Up @@ -303,6 +304,22 @@ unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int
case SKF_AD_IFINDEX:
A = skb->dev->ifindex;
continue;
case SKF_AD_NLATTR: {
struct nlattr *nla;

if (skb_is_nonlinear(skb))
return 0;
if (A > skb->len - sizeof(struct nlattr))
return 0;

nla = nla_find((struct nlattr *)&skb->data[A],
skb->len - A, X);
if (nla)
A = (void *)nla - (void *)skb->data;
else
A = 0;
continue;
}
default:
return 0;
}
Expand Down

0 comments on commit 370b245

Please sign in to comment.