: ingress socket filter by mark
Subsystems (5)
PATCH 1/1 : ingress socket filter by mark
apps can specify mark that they want to accept/reject.
cheers,
jamal
commit ec187e3028db866161b881c5ac9eeea4e9bb0f1f
Author: Jamal Hadi Salim <[email protected]> Date: Mon Oct 19 08:12:46 2009 -0400
[PATCH]: ingress socket filter by mark
Allow bpf to set a filter to drop packets that dont match a specific mark
Signed-off-by Jamal Hadi Salim <[email protected]>
include/linux/filter.h +2 -1
@@ -123,7 +123,8 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */#define SKF_AD_IFINDEX 8#define SKF_AD_NLATTR 12#define SKF_AD_NLATTR_NEST 16 -#define SKF_AD_MAX 20 +#define SKF_AD_MARK 20 +#define SKF_AD_MAX 24#define SKF_NET_OFF (-0x100000)#define SKF_LL_OFF (-0x200000)
net/core/filter.c +3 -0
@@ -303,6 +303,9 @@ load_b:case SKF_AD_IFINDEX :A = skb->dev->ifindex;continue ; +case SKF_AD_MARK : +A = skb->mark; +continue ;case SKF_AD_NLATTR : {struct nlattr *nla;