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
nexedi
linux
Commits
dc2a3808
Commit
dc2a3808
authored
Mar 04, 2004
by
David Stevens
Committed by
David S. Miller
Mar 04, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV4]: Add sysctl for per-socket limit on number of mcast src filters.
parent
416ecb64
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
4 deletions
+26
-4
include/linux/sysctl.h
include/linux/sysctl.h
+1
-0
net/ipv4/igmp.c
net/ipv4/igmp.c
+7
-1
net/ipv4/ip_sockglue.c
net/ipv4/ip_sockglue.c
+9
-3
net/ipv4/sysctl_net_ipv4.c
net/ipv4/sysctl_net_ipv4.c
+9
-0
No files found.
include/linux/sysctl.h
View file @
dc2a3808
...
@@ -321,6 +321,7 @@ enum
...
@@ -321,6 +321,7 @@ enum
NET_TCP_LOW_LATENCY
=
93
,
NET_TCP_LOW_LATENCY
=
93
,
NET_IPV4_IPFRAG_SECRET_INTERVAL
=
94
,
NET_IPV4_IPFRAG_SECRET_INTERVAL
=
94
,
NET_TCP_WESTWOOD
=
95
,
NET_TCP_WESTWOOD
=
95
,
NET_IPV4_IGMP_MAX_MSF
=
96
,
};
};
enum
{
enum
{
...
...
net/ipv4/igmp.c
View file @
dc2a3808
...
@@ -105,7 +105,8 @@
...
@@ -105,7 +105,8 @@
#include <linux/seq_file.h>
#include <linux/seq_file.h>
#endif
#endif
#define IP_MAX_MEMBERSHIPS 20
#define IP_MAX_MEMBERSHIPS 20
#define IP_MAX_MSF 10
#ifdef CONFIG_IP_MULTICAST
#ifdef CONFIG_IP_MULTICAST
/* Parameter names and values are taken from igmp-v2-06 draft */
/* Parameter names and values are taken from igmp-v2-06 draft */
...
@@ -1325,6 +1326,7 @@ static struct in_device * ip_mc_find_dev(struct ip_mreqn *imr)
...
@@ -1325,6 +1326,7 @@ static struct in_device * ip_mc_find_dev(struct ip_mreqn *imr)
* Join a socket to a group
* Join a socket to a group
*/
*/
int
sysctl_igmp_max_memberships
=
IP_MAX_MEMBERSHIPS
;
int
sysctl_igmp_max_memberships
=
IP_MAX_MEMBERSHIPS
;
int
sysctl_igmp_max_msf
=
IP_MAX_MSF
;
static
int
ip_mc_del1_src
(
struct
ip_mc_list
*
pmc
,
int
sfmode
,
static
int
ip_mc_del1_src
(
struct
ip_mc_list
*
pmc
,
int
sfmode
,
...
@@ -1790,6 +1792,10 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
...
@@ -1790,6 +1792,10 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct
}
}
/* else, add a new source to the filter */
/* else, add a new source to the filter */
if
(
psl
&&
psl
->
sl_count
>=
sysctl_igmp_max_msf
)
{
err
=
-
ENOBUFS
;
goto
done
;
}
if
(
!
psl
||
psl
->
sl_count
==
psl
->
sl_max
)
{
if
(
!
psl
||
psl
->
sl_count
==
psl
->
sl_max
)
{
struct
ip_sf_socklist
*
newpsl
;
struct
ip_sf_socklist
*
newpsl
;
int
count
=
IP_SFBLOCK
;
int
count
=
IP_SFBLOCK
;
...
...
net/ipv4/ip_sockglue.c
View file @
dc2a3808
...
@@ -618,6 +618,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
...
@@ -618,6 +618,7 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
case
IP_MSFILTER
:
case
IP_MSFILTER
:
{
{
extern
int
sysctl_optmem_max
;
extern
int
sysctl_optmem_max
;
extern
int
sysctl_igmp_max_msf
;
struct
ip_msfilter
*
msf
;
struct
ip_msfilter
*
msf
;
if
(
optlen
<
IP_MSFILTER_SIZE
(
0
))
if
(
optlen
<
IP_MSFILTER_SIZE
(
0
))
...
@@ -636,9 +637,14 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
...
@@ -636,9 +637,14 @@ int ip_setsockopt(struct sock *sk, int level, int optname, char *optval, int opt
kfree
(
msf
);
kfree
(
msf
);
break
;
break
;
}
}
if
(
IP_MSFILTER_SIZE
(
msf
->
imsf_numsrc
)
<
/* numsrc >= (1G-4) overflow in 32 bits */
IP_MSFILTER_SIZE
(
0
)
||
if
(
msf
->
imsf_numsrc
>=
0x3ffffffcU
||
IP_MSFILTER_SIZE
(
msf
->
imsf_numsrc
)
>
optlen
)
{
msf
->
imsf_numsrc
>
sysctl_igmp_max_msf
)
{
kfree
(
msf
);
err
=
-
ENOBUFS
;
break
;
}
if
(
IP_MSFILTER_SIZE
(
msf
->
imsf_numsrc
)
>
optlen
)
{
kfree
(
msf
);
kfree
(
msf
);
err
=
-
EINVAL
;
err
=
-
EINVAL
;
break
;
break
;
...
...
net/ipv4/sysctl_net_ipv4.c
View file @
dc2a3808
...
@@ -39,6 +39,7 @@ extern int sysctl_icmp_ratemask;
...
@@ -39,6 +39,7 @@ extern int sysctl_icmp_ratemask;
/* From igmp.c */
/* From igmp.c */
extern
int
sysctl_igmp_max_memberships
;
extern
int
sysctl_igmp_max_memberships
;
extern
int
sysctl_igmp_max_msf
;
/* From inetpeer.c */
/* From inetpeer.c */
extern
int
inet_peer_threshold
;
extern
int
inet_peer_threshold
;
...
@@ -411,6 +412,14 @@ ctl_table ipv4_table[] = {
...
@@ -411,6 +412,14 @@ ctl_table ipv4_table[] = {
},
},
#endif
#endif
{
.
ctl_name
=
NET_IPV4_IGMP_MAX_MSF
,
.
procname
=
"igmp_max_msf"
,
.
data
=
&
sysctl_igmp_max_msf
,
.
maxlen
=
sizeof
(
int
),
.
mode
=
0644
,
.
proc_handler
=
&
proc_dointvec
},
{
{
.
ctl_name
=
NET_IPV4_INET_PEER_THRESHOLD
,
.
ctl_name
=
NET_IPV4_INET_PEER_THRESHOLD
,
.
procname
=
"inet_peer_threshold"
,
.
procname
=
"inet_peer_threshold"
,
...
...
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