aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/filter.h2
-rw-r--r--net/core/filter.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/include/linux/filter.h b/include/linux/filter.h
index b885dcb7eaca..c43c8258e682 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -362,7 +362,7 @@ void sk_unattached_filter_destroy(struct sk_filter *fp);
362int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 362int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
363int sk_detach_filter(struct sock *sk); 363int sk_detach_filter(struct sock *sk);
364 364
365int sk_chk_filter(struct sock_filter *filter, unsigned int flen); 365int sk_chk_filter(const struct sock_filter *filter, unsigned int flen);
366int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, 366int sk_get_filter(struct sock *sk, struct sock_filter __user *filter,
367 unsigned int len); 367 unsigned int len);
368 368
diff --git a/net/core/filter.c b/net/core/filter.c
index 87af1e3e56c0..b90ae7fb3b89 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -1085,7 +1085,7 @@ err:
1085 * a cell if not previously written, and we check all branches to be sure 1085 * a cell if not previously written, and we check all branches to be sure
1086 * a malicious user doesn't try to abuse us. 1086 * a malicious user doesn't try to abuse us.
1087 */ 1087 */
1088static int check_load_and_stores(struct sock_filter *filter, int flen) 1088static int check_load_and_stores(const struct sock_filter *filter, int flen)
1089{ 1089{
1090 u16 *masks, memvalid = 0; /* One bit per cell, 16 cells */ 1090 u16 *masks, memvalid = 0; /* One bit per cell, 16 cells */
1091 int pc, ret = 0; 1091 int pc, ret = 0;
@@ -1218,7 +1218,7 @@ static bool chk_code_allowed(u16 code_to_probe)
1218 * 1218 *
1219 * Returns 0 if the rule set is legal or -EINVAL if not. 1219 * Returns 0 if the rule set is legal or -EINVAL if not.
1220 */ 1220 */
1221int sk_chk_filter(struct sock_filter *filter, unsigned int flen) 1221int sk_chk_filter(const struct sock_filter *filter, unsigned int flen)
1222{ 1222{
1223 bool anc_found; 1223 bool anc_found;
1224 int pc; 1224 int pc;
@@ -1228,7 +1228,7 @@ int sk_chk_filter(struct sock_filter *filter, unsigned int flen)
1228 1228
1229 /* Check the filter code now */ 1229 /* Check the filter code now */
1230 for (pc = 0; pc < flen; pc++) { 1230 for (pc = 0; pc < flen; pc++) {
1231 struct sock_filter *ftest = &filter[pc]; 1231 const struct sock_filter *ftest = &filter[pc];
1232 1232
1233 /* May we actually operate on this code? */ 1233 /* May we actually operate on this code? */
1234 if (!chk_code_allowed(ftest->code)) 1234 if (!chk_code_allowed(ftest->code))