summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDaniel Borkmann <daniel@iogearbox.net>2016-03-16 01:42:50 +0100
committerDavid S. Miller <davem@davemloft.net>2016-03-18 19:38:46 -0400
commit808c1b697c3c4dd2a7132882424c390b0d0acfb9 (patch)
treec43c9d8bd383b1c6063110c26c1ff495a37b5827 /net
parent09c37a2c5bbc28b5fbc07a01db4bccdbd0a5d8a2 (diff)
downloadlinux-808c1b697c3c4dd2a7132882424c390b0d0acfb9.tar.bz2
bpf, dst: add and use dst_tclassid helper
We can just add a small helper dst_tclassid() for retrieving the dst->tclassid value. It makes the code a bit better in that we can get rid of the ifdef from filter.c by moving this into the header. Signed-off-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/core/filter.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/net/core/filter.c b/net/core/filter.c
index 69c7b2fecf44..4c35d8325c34 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -1682,14 +1682,7 @@ static const struct bpf_func_proto bpf_get_cgroup_classid_proto = {
static u64 bpf_get_route_realm(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
{
-#ifdef CONFIG_IP_ROUTE_CLASSID
- const struct dst_entry *dst;
-
- dst = skb_dst((struct sk_buff *) (unsigned long) r1);
- if (dst)
- return dst->tclassid;
-#endif
- return 0;
+ return dst_tclassid((struct sk_buff *) (unsigned long) r1);
}
static const struct bpf_func_proto bpf_get_route_realm_proto = {