diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/filter.h | 15 | ||||
| -rw-r--r-- | include/linux/netdevice.h | 5 | ||||
| -rw-r--r-- | include/linux/yam.h | 2 | ||||
| -rw-r--r-- | include/net/cipso_ipv4.h | 6 | ||||
| -rw-r--r-- | include/net/dst.h | 12 | ||||
| -rw-r--r-- | include/net/ip6_route.h | 6 | ||||
| -rw-r--r-- | include/net/mac802154.h | 2 | ||||
| -rw-r--r-- | include/net/sock.h | 6 | ||||
| -rw-r--r-- | include/uapi/linux/tc_act/Kbuild | 1 | ||||
| -rw-r--r-- | include/uapi/linux/tc_act/tc_defact.h (renamed from include/linux/tc_act/tc_defact.h) | 2 |
10 files changed, 38 insertions, 19 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h index a6ac84871d6d..ff4e40cd45b1 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | #include <linux/atomic.h> | 7 | #include <linux/atomic.h> |
| 8 | #include <linux/compat.h> | 8 | #include <linux/compat.h> |
| 9 | #include <linux/workqueue.h> | ||
| 9 | #include <uapi/linux/filter.h> | 10 | #include <uapi/linux/filter.h> |
| 10 | 11 | ||
| 11 | #ifdef CONFIG_COMPAT | 12 | #ifdef CONFIG_COMPAT |
| @@ -25,15 +26,19 @@ struct sk_filter | |||
| 25 | { | 26 | { |
| 26 | atomic_t refcnt; | 27 | atomic_t refcnt; |
| 27 | unsigned int len; /* Number of filter blocks */ | 28 | unsigned int len; /* Number of filter blocks */ |
| 29 | struct rcu_head rcu; | ||
| 28 | unsigned int (*bpf_func)(const struct sk_buff *skb, | 30 | unsigned int (*bpf_func)(const struct sk_buff *skb, |
| 29 | const struct sock_filter *filter); | 31 | const struct sock_filter *filter); |
| 30 | struct rcu_head rcu; | 32 | union { |
| 31 | struct sock_filter insns[0]; | 33 | struct sock_filter insns[0]; |
| 34 | struct work_struct work; | ||
| 35 | }; | ||
| 32 | }; | 36 | }; |
| 33 | 37 | ||
| 34 | static inline unsigned int sk_filter_len(const struct sk_filter *fp) | 38 | static inline unsigned int sk_filter_size(unsigned int proglen) |
| 35 | { | 39 | { |
| 36 | return fp->len * sizeof(struct sock_filter) + sizeof(*fp); | 40 | return max(sizeof(struct sk_filter), |
| 41 | offsetof(struct sk_filter, insns[proglen])); | ||
| 37 | } | 42 | } |
| 38 | 43 | ||
| 39 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); | 44 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); |
| @@ -67,11 +72,13 @@ static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, | |||
| 67 | } | 72 | } |
| 68 | #define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) | 73 | #define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) |
| 69 | #else | 74 | #else |
| 75 | #include <linux/slab.h> | ||
| 70 | static inline void bpf_jit_compile(struct sk_filter *fp) | 76 | static inline void bpf_jit_compile(struct sk_filter *fp) |
| 71 | { | 77 | { |
| 72 | } | 78 | } |
| 73 | static inline void bpf_jit_free(struct sk_filter *fp) | 79 | static inline void bpf_jit_free(struct sk_filter *fp) |
| 74 | { | 80 | { |
| 81 | kfree(fp); | ||
| 75 | } | 82 | } |
| 76 | #define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) | 83 | #define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) |
| 77 | #endif | 84 | #endif |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3de49aca4519..25f5d2d11e7c 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -2264,11 +2264,12 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) | |||
| 2264 | } | 2264 | } |
| 2265 | 2265 | ||
| 2266 | #ifdef CONFIG_XPS | 2266 | #ifdef CONFIG_XPS |
| 2267 | extern int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask, | 2267 | extern int netif_set_xps_queue(struct net_device *dev, |
| 2268 | const struct cpumask *mask, | ||
| 2268 | u16 index); | 2269 | u16 index); |
| 2269 | #else | 2270 | #else |
| 2270 | static inline int netif_set_xps_queue(struct net_device *dev, | 2271 | static inline int netif_set_xps_queue(struct net_device *dev, |
| 2271 | struct cpumask *mask, | 2272 | const struct cpumask *mask, |
| 2272 | u16 index) | 2273 | u16 index) |
| 2273 | { | 2274 | { |
| 2274 | return 0; | 2275 | return 0; |
diff --git a/include/linux/yam.h b/include/linux/yam.h index 7fe28228b274..512cdc2fb80f 100644 --- a/include/linux/yam.h +++ b/include/linux/yam.h | |||
| @@ -77,6 +77,6 @@ struct yamdrv_ioctl_cfg { | |||
| 77 | 77 | ||
| 78 | struct yamdrv_ioctl_mcs { | 78 | struct yamdrv_ioctl_mcs { |
| 79 | int cmd; | 79 | int cmd; |
| 80 | int bitrate; | 80 | unsigned int bitrate; |
| 81 | unsigned char bits[YAM_FPGA_SIZE]; | 81 | unsigned char bits[YAM_FPGA_SIZE]; |
| 82 | }; | 82 | }; |
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index a7a683e30b64..a8c2ef6d3b93 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h | |||
| @@ -290,6 +290,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, | |||
| 290 | unsigned char err_offset = 0; | 290 | unsigned char err_offset = 0; |
| 291 | u8 opt_len = opt[1]; | 291 | u8 opt_len = opt[1]; |
| 292 | u8 opt_iter; | 292 | u8 opt_iter; |
| 293 | u8 tag_len; | ||
| 293 | 294 | ||
| 294 | if (opt_len < 8) { | 295 | if (opt_len < 8) { |
| 295 | err_offset = 1; | 296 | err_offset = 1; |
| @@ -302,11 +303,12 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, | |||
| 302 | } | 303 | } |
| 303 | 304 | ||
| 304 | for (opt_iter = 6; opt_iter < opt_len;) { | 305 | for (opt_iter = 6; opt_iter < opt_len;) { |
| 305 | if (opt[opt_iter + 1] > (opt_len - opt_iter)) { | 306 | tag_len = opt[opt_iter + 1]; |
| 307 | if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { | ||
| 306 | err_offset = opt_iter + 1; | 308 | err_offset = opt_iter + 1; |
| 307 | goto out; | 309 | goto out; |
| 308 | } | 310 | } |
| 309 | opt_iter += opt[opt_iter + 1]; | 311 | opt_iter += tag_len; |
| 310 | } | 312 | } |
| 311 | 313 | ||
| 312 | out: | 314 | out: |
diff --git a/include/net/dst.h b/include/net/dst.h index 3bc4865f8267..3c4c944096c9 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -479,10 +479,22 @@ static inline struct dst_entry *xfrm_lookup(struct net *net, | |||
| 479 | { | 479 | { |
| 480 | return dst_orig; | 480 | return dst_orig; |
| 481 | } | 481 | } |
| 482 | |||
| 483 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) | ||
| 484 | { | ||
| 485 | return NULL; | ||
| 486 | } | ||
| 487 | |||
| 482 | #else | 488 | #else |
| 483 | extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, | 489 | extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, |
| 484 | const struct flowi *fl, struct sock *sk, | 490 | const struct flowi *fl, struct sock *sk, |
| 485 | int flags); | 491 | int flags); |
| 492 | |||
| 493 | /* skb attached with this dst needs transformation if dst->xfrm is valid */ | ||
| 494 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) | ||
| 495 | { | ||
| 496 | return dst->xfrm; | ||
| 497 | } | ||
| 486 | #endif | 498 | #endif |
| 487 | 499 | ||
| 488 | #endif /* _NET_DST_H */ | 500 | #endif /* _NET_DST_H */ |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index f525e7038cca..2b786b7e3585 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
| @@ -194,11 +194,9 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | |||
| 194 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 194 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); |
| 195 | } | 195 | } |
| 196 | 196 | ||
| 197 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *dest) | 197 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt) |
| 198 | { | 198 | { |
| 199 | if (rt->rt6i_flags & RTF_GATEWAY) | 199 | return &rt->rt6i_gateway; |
| 200 | return &rt->rt6i_gateway; | ||
| 201 | return dest; | ||
| 202 | } | 200 | } |
| 203 | 201 | ||
| 204 | #endif | 202 | #endif |
diff --git a/include/net/mac802154.h b/include/net/mac802154.h index d0d11df9cba1..807d6b7a943f 100644 --- a/include/net/mac802154.h +++ b/include/net/mac802154.h | |||
| @@ -133,7 +133,7 @@ struct ieee802154_ops { | |||
| 133 | 133 | ||
| 134 | /* Basic interface to register ieee802154 device */ | 134 | /* Basic interface to register ieee802154 device */ |
| 135 | struct ieee802154_dev * | 135 | struct ieee802154_dev * |
| 136 | ieee802154_alloc_device(size_t priv_data_lex, struct ieee802154_ops *ops); | 136 | ieee802154_alloc_device(size_t priv_data_len, struct ieee802154_ops *ops); |
| 137 | void ieee802154_free_device(struct ieee802154_dev *dev); | 137 | void ieee802154_free_device(struct ieee802154_dev *dev); |
| 138 | int ieee802154_register_device(struct ieee802154_dev *dev); | 138 | int ieee802154_register_device(struct ieee802154_dev *dev); |
| 139 | void ieee802154_unregister_device(struct ieee802154_dev *dev); | 139 | void ieee802154_unregister_device(struct ieee802154_dev *dev); |
diff --git a/include/net/sock.h b/include/net/sock.h index 1d37a8086bed..808cbc2ec6c1 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
| @@ -1630,16 +1630,14 @@ static inline void sk_filter_release(struct sk_filter *fp) | |||
| 1630 | 1630 | ||
| 1631 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) | 1631 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) |
| 1632 | { | 1632 | { |
| 1633 | unsigned int size = sk_filter_len(fp); | 1633 | atomic_sub(sk_filter_size(fp->len), &sk->sk_omem_alloc); |
| 1634 | |||
| 1635 | atomic_sub(size, &sk->sk_omem_alloc); | ||
| 1636 | sk_filter_release(fp); | 1634 | sk_filter_release(fp); |
| 1637 | } | 1635 | } |
| 1638 | 1636 | ||
| 1639 | static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp) | 1637 | static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp) |
| 1640 | { | 1638 | { |
| 1641 | atomic_inc(&fp->refcnt); | 1639 | atomic_inc(&fp->refcnt); |
| 1642 | atomic_add(sk_filter_len(fp), &sk->sk_omem_alloc); | 1640 | atomic_add(sk_filter_size(fp->len), &sk->sk_omem_alloc); |
| 1643 | } | 1641 | } |
| 1644 | 1642 | ||
| 1645 | /* | 1643 | /* |
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild index 0623ec4e728f..56f121605c99 100644 --- a/include/uapi/linux/tc_act/Kbuild +++ b/include/uapi/linux/tc_act/Kbuild | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | # UAPI Header export list | 1 | # UAPI Header export list |
| 2 | header-y += tc_csum.h | 2 | header-y += tc_csum.h |
| 3 | header-y += tc_defact.h | ||
| 3 | header-y += tc_gact.h | 4 | header-y += tc_gact.h |
| 4 | header-y += tc_ipt.h | 5 | header-y += tc_ipt.h |
| 5 | header-y += tc_mirred.h | 6 | header-y += tc_mirred.h |
diff --git a/include/linux/tc_act/tc_defact.h b/include/uapi/linux/tc_act/tc_defact.h index 6f65d07c7ce2..17dddb40f740 100644 --- a/include/linux/tc_act/tc_defact.h +++ b/include/uapi/linux/tc_act/tc_defact.h | |||
| @@ -6,7 +6,7 @@ | |||
| 6 | struct tc_defact { | 6 | struct tc_defact { |
| 7 | tc_gen; | 7 | tc_gen; |
| 8 | }; | 8 | }; |
| 9 | 9 | ||
| 10 | enum { | 10 | enum { |
| 11 | TCA_DEF_UNSPEC, | 11 | TCA_DEF_UNSPEC, |
| 12 | TCA_DEF_TM, | 12 | TCA_DEF_TM, |
