Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
38bdbd8e
Commit
38bdbd8e
authored
Feb 26, 2010
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
parents
773c3e75
6b4ff2d7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
66 additions
and
53 deletions
+66
-53
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/arp_tables.c
+14
-9
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ip_tables.c
+15
-10
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/ip6_tables.c
+15
-10
net/netfilter/ipvs/ip_vs_lblcr.c
net/netfilter/ipvs/ip_vs_lblcr.c
+21
-23
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_log.c
+1
-1
No files found.
net/ipv4/netfilter/arp_tables.c
View file @
38bdbd8e
...
@@ -644,7 +644,9 @@ static int translate_table(struct xt_table_info *newinfo, void *entry0,
...
@@ -644,7 +644,9 @@ static int translate_table(struct xt_table_info *newinfo, void *entry0,
/* Walk through entries, checking offsets. */
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter
,
entry0
,
newinfo
->
size
)
{
xt_entry_foreach
(
iter
,
entry0
,
newinfo
->
size
)
{
ret
=
check_entry_size_and_hooks
(
iter
,
newinfo
,
entry0
,
ret
=
check_entry_size_and_hooks
(
iter
,
newinfo
,
entry0
,
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
repl
->
valid_hooks
);
repl
->
valid_hooks
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
break
;
break
;
...
@@ -1356,7 +1358,10 @@ static int translate_compat_table(const char *name,
...
@@ -1356,7 +1358,10 @@ static int translate_compat_table(const char *name,
/* Walk through entries, checking offsets. */
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
check_compat_entry_size_and_hooks
(
iter0
,
info
,
&
size
,
ret
=
check_compat_entry_size_and_hooks
(
iter0
,
info
,
&
size
,
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
name
);
name
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
goto
out_unlock
;
goto
out_unlock
;
...
@@ -1401,8 +1406,8 @@ static int translate_compat_table(const char *name,
...
@@ -1401,8 +1406,8 @@ static int translate_compat_table(const char *name,
pos
=
entry1
;
pos
=
entry1
;
size
=
total_size
;
size
=
total_size
;
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
&
size
,
&
size
,
name
,
newinfo
,
entry1
);
name
,
newinfo
,
entry1
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
break
;
break
;
}
}
...
...
net/ipv4/netfilter/ip_tables.c
View file @
38bdbd8e
...
@@ -836,7 +836,9 @@ translate_table(struct net *net, struct xt_table_info *newinfo, void *entry0,
...
@@ -836,7 +836,9 @@ translate_table(struct net *net, struct xt_table_info *newinfo, void *entry0,
/* Walk through entries, checking offsets. */
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter
,
entry0
,
newinfo
->
size
)
{
xt_entry_foreach
(
iter
,
entry0
,
newinfo
->
size
)
{
ret
=
check_entry_size_and_hooks
(
iter
,
newinfo
,
entry0
,
ret
=
check_entry_size_and_hooks
(
iter
,
newinfo
,
entry0
,
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
repl
->
valid_hooks
);
repl
->
valid_hooks
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
return
ret
;
return
ret
;
...
@@ -1701,7 +1703,10 @@ translate_compat_table(struct net *net,
...
@@ -1701,7 +1703,10 @@ translate_compat_table(struct net *net,
/* Walk through entries, checking offsets. */
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
check_compat_entry_size_and_hooks
(
iter0
,
info
,
&
size
,
ret
=
check_compat_entry_size_and_hooks
(
iter0
,
info
,
&
size
,
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
name
);
name
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
goto
out_unlock
;
goto
out_unlock
;
...
@@ -1746,8 +1751,8 @@ translate_compat_table(struct net *net,
...
@@ -1746,8 +1751,8 @@ translate_compat_table(struct net *net,
pos
=
entry1
;
pos
=
entry1
;
size
=
total_size
;
size
=
total_size
;
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
&
size
,
&
size
,
name
,
newinfo
,
entry1
);
name
,
newinfo
,
entry1
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
break
;
break
;
}
}
...
...
net/ipv6/netfilter/ip6_tables.c
View file @
38bdbd8e
...
@@ -866,7 +866,9 @@ translate_table(struct net *net, struct xt_table_info *newinfo, void *entry0,
...
@@ -866,7 +866,9 @@ translate_table(struct net *net, struct xt_table_info *newinfo, void *entry0,
/* Walk through entries, checking offsets. */
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter
,
entry0
,
newinfo
->
size
)
{
xt_entry_foreach
(
iter
,
entry0
,
newinfo
->
size
)
{
ret
=
check_entry_size_and_hooks
(
iter
,
newinfo
,
entry0
,
ret
=
check_entry_size_and_hooks
(
iter
,
newinfo
,
entry0
,
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
repl
->
valid_hooks
);
repl
->
valid_hooks
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
return
ret
;
return
ret
;
...
@@ -1734,7 +1736,10 @@ translate_compat_table(struct net *net,
...
@@ -1734,7 +1736,10 @@ translate_compat_table(struct net *net,
/* Walk through entries, checking offsets. */
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
check_compat_entry_size_and_hooks
(
iter0
,
info
,
&
size
,
ret
=
check_compat_entry_size_and_hooks
(
iter0
,
info
,
&
size
,
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
name
);
name
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
goto
out_unlock
;
goto
out_unlock
;
...
@@ -1779,8 +1784,8 @@ translate_compat_table(struct net *net,
...
@@ -1779,8 +1784,8 @@ translate_compat_table(struct net *net,
pos
=
entry1
;
pos
=
entry1
;
size
=
total_size
;
size
=
total_size
;
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
&
size
,
&
size
,
name
,
newinfo
,
entry1
);
name
,
newinfo
,
entry1
);
if
(
ret
!=
0
)
if
(
ret
!=
0
)
break
;
break
;
}
}
...
...
net/netfilter/ipvs/ip_vs_lblcr.c
View file @
38bdbd8e
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/skbuff.h>
#include <linux/jiffies.h>
#include <linux/jiffies.h>
#include <linux/list.h>
/* for sysctl */
/* for sysctl */
#include <linux/fs.h>
#include <linux/fs.h>
...
@@ -85,25 +86,25 @@ static int sysctl_ip_vs_lblcr_expiration = 24*60*60*HZ;
...
@@ -85,25 +86,25 @@ static int sysctl_ip_vs_lblcr_expiration = 24*60*60*HZ;
/*
/*
* IPVS destination set structure and operations
* IPVS destination set structure and operations
*/
*/
struct
ip_vs_dest_
list
{
struct
ip_vs_dest_
set_elem
{
struct
ip_vs_dest_list
*
nex
t
;
/* list link */
struct
list_head
lis
t
;
/* list link */
struct
ip_vs_dest
*
dest
;
/* destination server */
struct
ip_vs_dest
*
dest
;
/* destination server */
};
};
struct
ip_vs_dest_set
{
struct
ip_vs_dest_set
{
atomic_t
size
;
/* set size */
atomic_t
size
;
/* set size */
unsigned
long
lastmod
;
/* last modified time */
unsigned
long
lastmod
;
/* last modified time */
struct
ip_vs_dest_list
*
list
;
/* destination list */
struct
list_head
list
;
/* destination list */
rwlock_t
lock
;
/* lock for this list */
rwlock_t
lock
;
/* lock for this list */
};
};
static
struct
ip_vs_dest_
list
*
static
struct
ip_vs_dest_
set_elem
*
ip_vs_dest_set_insert
(
struct
ip_vs_dest_set
*
set
,
struct
ip_vs_dest
*
dest
)
ip_vs_dest_set_insert
(
struct
ip_vs_dest_set
*
set
,
struct
ip_vs_dest
*
dest
)
{
{
struct
ip_vs_dest_
list
*
e
;
struct
ip_vs_dest_
set_elem
*
e
;
for
(
e
=
set
->
list
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
if
(
e
->
dest
==
dest
)
if
(
e
->
dest
==
dest
)
/* already existed */
/* already existed */
return
NULL
;
return
NULL
;
...
@@ -118,9 +119,7 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest)
...
@@ -118,9 +119,7 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest)
atomic_inc
(
&
dest
->
refcnt
);
atomic_inc
(
&
dest
->
refcnt
);
e
->
dest
=
dest
;
e
->
dest
=
dest
;
/* link it to the list */
list_add
(
&
e
->
list
,
&
set
->
list
);
e
->
next
=
set
->
list
;
set
->
list
=
e
;
atomic_inc
(
&
set
->
size
);
atomic_inc
(
&
set
->
size
);
set
->
lastmod
=
jiffies
;
set
->
lastmod
=
jiffies
;
...
@@ -130,34 +129,33 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest)
...
@@ -130,34 +129,33 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest)
static
void
static
void
ip_vs_dest_set_erase
(
struct
ip_vs_dest_set
*
set
,
struct
ip_vs_dest
*
dest
)
ip_vs_dest_set_erase
(
struct
ip_vs_dest_set
*
set
,
struct
ip_vs_dest
*
dest
)
{
{
struct
ip_vs_dest_
list
*
e
,
**
ep
;
struct
ip_vs_dest_
set_elem
*
e
;
for
(
ep
=&
set
->
list
,
e
=*
ep
;
e
!=
NULL
;
e
=*
ep
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
list
)
{
if
(
e
->
dest
==
dest
)
{
if
(
e
->
dest
==
dest
)
{
/* HIT */
/* HIT */
*
ep
=
e
->
next
;
atomic_dec
(
&
set
->
size
);
atomic_dec
(
&
set
->
size
);
set
->
lastmod
=
jiffies
;
set
->
lastmod
=
jiffies
;
atomic_dec
(
&
e
->
dest
->
refcnt
);
atomic_dec
(
&
e
->
dest
->
refcnt
);
list_del
(
&
e
->
list
);
kfree
(
e
);
kfree
(
e
);
break
;
break
;
}
}
ep
=
&
e
->
next
;
}
}
}
}
static
void
ip_vs_dest_set_eraseall
(
struct
ip_vs_dest_set
*
set
)
static
void
ip_vs_dest_set_eraseall
(
struct
ip_vs_dest_set
*
set
)
{
{
struct
ip_vs_dest_
list
*
e
,
*
*
ep
;
struct
ip_vs_dest_
set_elem
*
e
,
*
ep
;
write_lock
(
&
set
->
lock
);
write_lock
(
&
set
->
lock
);
for
(
ep
=&
set
->
list
,
e
=*
ep
;
e
!=
NULL
;
e
=*
ep
)
{
list_for_each_entry_safe
(
e
,
ep
,
&
set
->
list
,
list
)
{
*
ep
=
e
->
next
;
/*
/*
* We don't kfree dest because it is refered either
* We don't kfree dest because it is refered either
* by its service or by the trash dest list.
* by its service or by the trash dest list.
*/
*/
atomic_dec
(
&
e
->
dest
->
refcnt
);
atomic_dec
(
&
e
->
dest
->
refcnt
);
list_del
(
&
e
->
list
);
kfree
(
e
);
kfree
(
e
);
}
}
write_unlock
(
&
set
->
lock
);
write_unlock
(
&
set
->
lock
);
...
@@ -166,7 +164,7 @@ static void ip_vs_dest_set_eraseall(struct ip_vs_dest_set *set)
...
@@ -166,7 +164,7 @@ static void ip_vs_dest_set_eraseall(struct ip_vs_dest_set *set)
/* get weighted least-connection node in the destination set */
/* get weighted least-connection node in the destination set */
static
inline
struct
ip_vs_dest
*
ip_vs_dest_set_min
(
struct
ip_vs_dest_set
*
set
)
static
inline
struct
ip_vs_dest
*
ip_vs_dest_set_min
(
struct
ip_vs_dest_set
*
set
)
{
{
register
struct
ip_vs_dest_
list
*
e
;
register
struct
ip_vs_dest_
set_elem
*
e
;
struct
ip_vs_dest
*
dest
,
*
least
;
struct
ip_vs_dest
*
dest
,
*
least
;
int
loh
,
doh
;
int
loh
,
doh
;
...
@@ -174,7 +172,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
...
@@ -174,7 +172,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
return
NULL
;
return
NULL
;
/* select the first destination server, whose weight > 0 */
/* select the first destination server, whose weight > 0 */
for
(
e
=
set
->
list
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
least
=
e
->
dest
;
least
=
e
->
dest
;
if
(
least
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
if
(
least
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
continue
;
...
@@ -190,7 +188,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
...
@@ -190,7 +188,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
/* find the destination with the weighted least load */
/* find the destination with the weighted least load */
nextstage:
nextstage:
for
(
e
=
e
->
next
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
dest
=
e
->
dest
;
dest
=
e
->
dest
;
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
continue
;
...
@@ -220,7 +218,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
...
@@ -220,7 +218,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
/* get weighted most-connection node in the destination set */
/* get weighted most-connection node in the destination set */
static
inline
struct
ip_vs_dest
*
ip_vs_dest_set_max
(
struct
ip_vs_dest_set
*
set
)
static
inline
struct
ip_vs_dest
*
ip_vs_dest_set_max
(
struct
ip_vs_dest_set
*
set
)
{
{
register
struct
ip_vs_dest_
list
*
e
;
register
struct
ip_vs_dest_
set_elem
*
e
;
struct
ip_vs_dest
*
dest
,
*
most
;
struct
ip_vs_dest
*
dest
,
*
most
;
int
moh
,
doh
;
int
moh
,
doh
;
...
@@ -228,7 +226,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
...
@@ -228,7 +226,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
return
NULL
;
return
NULL
;
/* select the first destination server, whose weight > 0 */
/* select the first destination server, whose weight > 0 */
for
(
e
=
set
->
list
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
most
=
e
->
dest
;
most
=
e
->
dest
;
if
(
atomic_read
(
&
most
->
weight
)
>
0
)
{
if
(
atomic_read
(
&
most
->
weight
)
>
0
)
{
moh
=
atomic_read
(
&
most
->
activeconns
)
*
50
moh
=
atomic_read
(
&
most
->
activeconns
)
*
50
...
@@ -240,7 +238,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
...
@@ -240,7 +238,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
/* find the destination with the weighted most load */
/* find the destination with the weighted most load */
nextstage:
nextstage:
for
(
e
=
e
->
next
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
dest
=
e
->
dest
;
dest
=
e
->
dest
;
doh
=
atomic_read
(
&
dest
->
activeconns
)
*
50
doh
=
atomic_read
(
&
dest
->
activeconns
)
*
50
+
atomic_read
(
&
dest
->
inactconns
);
+
atomic_read
(
&
dest
->
inactconns
);
...
@@ -389,7 +387,7 @@ ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr,
...
@@ -389,7 +387,7 @@ ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr,
/* initilize its dest set */
/* initilize its dest set */
atomic_set
(
&
(
en
->
set
.
size
),
0
);
atomic_set
(
&
(
en
->
set
.
size
),
0
);
en
->
set
.
list
=
NULL
;
INIT_LIST_HEAD
(
&
en
->
set
.
list
)
;
rwlock_init
(
&
en
->
set
.
lock
);
rwlock_init
(
&
en
->
set
.
lock
);
ip_vs_lblcr_hash
(
tbl
,
en
);
ip_vs_lblcr_hash
(
tbl
,
en
);
...
...
net/netfilter/nfnetlink_log.c
View file @
38bdbd8e
...
@@ -768,7 +768,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
...
@@ -768,7 +768,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
}
}
instance_destroy
(
inst
);
instance_destroy
(
inst
);
goto
out
;
goto
out
_put
;
default:
default:
ret
=
-
ENOTSUPP
;
ret
=
-
ENOTSUPP
;
break
;
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment