diff options
| -rw-r--r-- | include/net/ip_vs.h | 17 | ||||
| -rw-r--r-- | net/bridge/netfilter/ebtables.c | 64 | ||||
| -rw-r--r-- | net/ipv6/netfilter/ip6t_REJECT.c | 4 | ||||
| -rw-r--r-- | net/netfilter/ipvs/ip_vs_app.c | 15 | ||||
| -rw-r--r-- | net/netfilter/ipvs/ip_vs_conn.c | 12 | ||||
| -rw-r--r-- | net/netfilter/ipvs/ip_vs_core.c | 103 | ||||
| -rw-r--r-- | net/netfilter/ipvs/ip_vs_ctl.c | 120 | ||||
| -rw-r--r-- | net/netfilter/ipvs/ip_vs_est.c | 14 | ||||
| -rw-r--r-- | net/netfilter/ipvs/ip_vs_proto.c | 11 | ||||
| -rw-r--r-- | net/netfilter/ipvs/ip_vs_sync.c | 65 | ||||
| -rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 4 | ||||
| -rw-r--r-- | net/netfilter/x_tables.c | 4 | ||||
| -rw-r--r-- | net/netfilter/xt_DSCP.c | 2 | ||||
| -rw-r--r-- | net/netfilter/xt_conntrack.c | 5 |
14 files changed, 279 insertions, 161 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index d516f00c8e0f..86aefed6140b 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -791,6 +791,7 @@ struct ip_vs_app { | |||
| 791 | /* IPVS in network namespace */ | 791 | /* IPVS in network namespace */ |
| 792 | struct netns_ipvs { | 792 | struct netns_ipvs { |
| 793 | int gen; /* Generation */ | 793 | int gen; /* Generation */ |
| 794 | int enable; /* enable like nf_hooks do */ | ||
| 794 | /* | 795 | /* |
| 795 | * Hash table: for real service lookups | 796 | * Hash table: for real service lookups |
| 796 | */ | 797 | */ |
| @@ -1089,6 +1090,22 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp) | |||
| 1089 | atomic_inc(&ctl_cp->n_control); | 1090 | atomic_inc(&ctl_cp->n_control); |
| 1090 | } | 1091 | } |
| 1091 | 1092 | ||
| 1093 | /* | ||
| 1094 | * IPVS netns init & cleanup functions | ||
| 1095 | */ | ||
| 1096 | extern int __ip_vs_estimator_init(struct net *net); | ||
| 1097 | extern int __ip_vs_control_init(struct net *net); | ||
| 1098 | extern int __ip_vs_protocol_init(struct net *net); | ||
| 1099 | extern int __ip_vs_app_init(struct net *net); | ||
| 1100 | extern int __ip_vs_conn_init(struct net *net); | ||
| 1101 | extern int __ip_vs_sync_init(struct net *net); | ||
| 1102 | extern void __ip_vs_conn_cleanup(struct net *net); | ||
| 1103 | extern void __ip_vs_app_cleanup(struct net *net); | ||
| 1104 | extern void __ip_vs_protocol_cleanup(struct net *net); | ||
| 1105 | extern void __ip_vs_control_cleanup(struct net *net); | ||
| 1106 | extern void __ip_vs_estimator_cleanup(struct net *net); | ||
| 1107 | extern void __ip_vs_sync_cleanup(struct net *net); | ||
| 1108 | extern void __ip_vs_service_cleanup(struct net *net); | ||
| 1092 | 1109 | ||
| 1093 | /* | 1110 | /* |
| 1094 | * IPVS application functions | 1111 | * IPVS application functions |
diff --git a/net/bridge/netfilter/ebtables.c b/net/bridge/netfilter/ebtables.c index 893669caa8de..1a92b369c820 100644 --- a/net/bridge/netfilter/ebtables.c +++ b/net/bridge/netfilter/ebtables.c | |||
| @@ -1766,7 +1766,7 @@ static int compat_table_info(const struct ebt_table_info *info, | |||
| 1766 | 1766 | ||
| 1767 | newinfo->entries_size = size; | 1767 | newinfo->entries_size = size; |
| 1768 | 1768 | ||
| 1769 | xt_compat_init_offsets(AF_INET, info->nentries); | 1769 | xt_compat_init_offsets(NFPROTO_BRIDGE, info->nentries); |
| 1770 | return EBT_ENTRY_ITERATE(entries, size, compat_calc_entry, info, | 1770 | return EBT_ENTRY_ITERATE(entries, size, compat_calc_entry, info, |
| 1771 | entries, newinfo); | 1771 | entries, newinfo); |
| 1772 | } | 1772 | } |
| @@ -1882,7 +1882,7 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt, | |||
| 1882 | struct xt_match *match; | 1882 | struct xt_match *match; |
| 1883 | struct xt_target *wt; | 1883 | struct xt_target *wt; |
| 1884 | void *dst = NULL; | 1884 | void *dst = NULL; |
| 1885 | int off, pad = 0, ret = 0; | 1885 | int off, pad = 0; |
| 1886 | unsigned int size_kern, entry_offset, match_size = mwt->match_size; | 1886 | unsigned int size_kern, entry_offset, match_size = mwt->match_size; |
| 1887 | 1887 | ||
| 1888 | strlcpy(name, mwt->u.name, sizeof(name)); | 1888 | strlcpy(name, mwt->u.name, sizeof(name)); |
| @@ -1935,13 +1935,6 @@ static int compat_mtw_from_user(struct compat_ebt_entry_mwt *mwt, | |||
| 1935 | break; | 1935 | break; |
| 1936 | } | 1936 | } |
| 1937 | 1937 | ||
| 1938 | if (!dst) { | ||
| 1939 | ret = xt_compat_add_offset(NFPROTO_BRIDGE, entry_offset, | ||
| 1940 | off + ebt_compat_entry_padsize()); | ||
| 1941 | if (ret < 0) | ||
| 1942 | return ret; | ||
| 1943 | } | ||
| 1944 | |||
| 1945 | state->buf_kern_offset += match_size + off; | 1938 | state->buf_kern_offset += match_size + off; |
| 1946 | state->buf_user_offset += match_size; | 1939 | state->buf_user_offset += match_size; |
| 1947 | pad = XT_ALIGN(size_kern) - size_kern; | 1940 | pad = XT_ALIGN(size_kern) - size_kern; |
| @@ -2016,50 +2009,6 @@ static int ebt_size_mwt(struct compat_ebt_entry_mwt *match32, | |||
| 2016 | return growth; | 2009 | return growth; |
| 2017 | } | 2010 | } |
| 2018 | 2011 | ||
| 2019 | #define EBT_COMPAT_WATCHER_ITERATE(e, fn, args...) \ | ||
| 2020 | ({ \ | ||
| 2021 | unsigned int __i; \ | ||
| 2022 | int __ret = 0; \ | ||
| 2023 | struct compat_ebt_entry_mwt *__watcher; \ | ||
| 2024 | \ | ||
| 2025 | for (__i = e->watchers_offset; \ | ||
| 2026 | __i < (e)->target_offset; \ | ||
| 2027 | __i += __watcher->watcher_size + \ | ||
| 2028 | sizeof(struct compat_ebt_entry_mwt)) { \ | ||
| 2029 | __watcher = (void *)(e) + __i; \ | ||
| 2030 | __ret = fn(__watcher , ## args); \ | ||
| 2031 | if (__ret != 0) \ | ||
| 2032 | break; \ | ||
| 2033 | } \ | ||
| 2034 | if (__ret == 0) { \ | ||
| 2035 | if (__i != (e)->target_offset) \ | ||
| 2036 | __ret = -EINVAL; \ | ||
| 2037 | } \ | ||
| 2038 | __ret; \ | ||
| 2039 | }) | ||
| 2040 | |||
| 2041 | #define EBT_COMPAT_MATCH_ITERATE(e, fn, args...) \ | ||
| 2042 | ({ \ | ||
| 2043 | unsigned int __i; \ | ||
| 2044 | int __ret = 0; \ | ||
| 2045 | struct compat_ebt_entry_mwt *__match; \ | ||
| 2046 | \ | ||
| 2047 | for (__i = sizeof(struct ebt_entry); \ | ||
| 2048 | __i < (e)->watchers_offset; \ | ||
| 2049 | __i += __match->match_size + \ | ||
| 2050 | sizeof(struct compat_ebt_entry_mwt)) { \ | ||
| 2051 | __match = (void *)(e) + __i; \ | ||
| 2052 | __ret = fn(__match , ## args); \ | ||
| 2053 | if (__ret != 0) \ | ||
| 2054 | break; \ | ||
| 2055 | } \ | ||
| 2056 | if (__ret == 0) { \ | ||
| 2057 | if (__i != (e)->watchers_offset) \ | ||
| 2058 | __ret = -EINVAL; \ | ||
| 2059 | } \ | ||
| 2060 | __ret; \ | ||
| 2061 | }) | ||
| 2062 | |||
| 2063 | /* called for all ebt_entry structures. */ | 2012 | /* called for all ebt_entry structures. */ |
| 2064 | static int size_entry_mwt(struct ebt_entry *entry, const unsigned char *base, | 2013 | static int size_entry_mwt(struct ebt_entry *entry, const unsigned char *base, |
| 2065 | unsigned int *total, | 2014 | unsigned int *total, |
| @@ -2132,6 +2081,14 @@ static int size_entry_mwt(struct ebt_entry *entry, const unsigned char *base, | |||
| 2132 | } | 2081 | } |
| 2133 | } | 2082 | } |
| 2134 | 2083 | ||
| 2084 | if (state->buf_kern_start == NULL) { | ||
| 2085 | unsigned int offset = buf_start - (char *) base; | ||
| 2086 | |||
| 2087 | ret = xt_compat_add_offset(NFPROTO_BRIDGE, offset, new_offset); | ||
| 2088 | if (ret < 0) | ||
| 2089 | return ret; | ||
| 2090 | } | ||
| 2091 | |||
| 2135 | startoff = state->buf_user_offset - startoff; | 2092 | startoff = state->buf_user_offset - startoff; |
| 2136 | 2093 | ||
| 2137 | BUG_ON(*total < startoff); | 2094 | BUG_ON(*total < startoff); |
| @@ -2240,6 +2197,7 @@ static int compat_do_replace(struct net *net, void __user *user, | |||
| 2240 | 2197 | ||
| 2241 | xt_compat_lock(NFPROTO_BRIDGE); | 2198 | xt_compat_lock(NFPROTO_BRIDGE); |
| 2242 | 2199 | ||
| 2200 | xt_compat_init_offsets(NFPROTO_BRIDGE, tmp.nentries); | ||
| 2243 | ret = compat_copy_entries(entries_tmp, tmp.entries_size, &state); | 2201 | ret = compat_copy_entries(entries_tmp, tmp.entries_size, &state); |
| 2244 | if (ret < 0) | 2202 | if (ret < 0) |
| 2245 | goto out_unlock; | 2203 | goto out_unlock; |
diff --git a/net/ipv6/netfilter/ip6t_REJECT.c b/net/ipv6/netfilter/ip6t_REJECT.c index 28e74488a329..a5a4c5dd5396 100644 --- a/net/ipv6/netfilter/ip6t_REJECT.c +++ b/net/ipv6/netfilter/ip6t_REJECT.c | |||
| @@ -45,6 +45,8 @@ static void send_reset(struct net *net, struct sk_buff *oldskb) | |||
| 45 | int tcphoff, needs_ack; | 45 | int tcphoff, needs_ack; |
| 46 | const struct ipv6hdr *oip6h = ipv6_hdr(oldskb); | 46 | const struct ipv6hdr *oip6h = ipv6_hdr(oldskb); |
| 47 | struct ipv6hdr *ip6h; | 47 | struct ipv6hdr *ip6h; |
| 48 | #define DEFAULT_TOS_VALUE 0x0U | ||
| 49 | const __u8 tclass = DEFAULT_TOS_VALUE; | ||
| 48 | struct dst_entry *dst = NULL; | 50 | struct dst_entry *dst = NULL; |
| 49 | u8 proto; | 51 | u8 proto; |
