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
62343f76
Commit
62343f76
authored
Jan 13, 2005
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/acme/connection_sock-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
parents
c749c9cc
c76178d6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
include/net/icmp.h
include/net/icmp.h
+7
-8
net/ipv4/raw.c
net/ipv4/raw.c
+6
-5
No files found.
include/net/icmp.h
View file @
62343f76
...
@@ -46,16 +46,15 @@ extern void icmp_init(struct net_proto_family *ops);
...
@@ -46,16 +46,15 @@ extern void icmp_init(struct net_proto_family *ops);
/* Move into dst.h ? */
/* Move into dst.h ? */
extern
int
xrlim_allow
(
struct
dst_entry
*
dst
,
int
timeout
);
extern
int
xrlim_allow
(
struct
dst_entry
*
dst
,
int
timeout
);
struct
raw_opt
{
struct
icmp_filter
filter
;
};
/* WARNING: don't change the layout of the members in raw_sock! */
struct
raw_sock
{
struct
raw_sock
{
struct
inet_sock
inet
;
/* inet_sock has to be the first member */
struct
raw_opt
raw4
;
struct
inet_sock
inet
;
struct
icmp_filter
filter
;
};
};
#define raw4_sk(__sk) (&((struct raw_sock *)__sk)->raw4)
static
inline
struct
raw_sock
*
raw_sk
(
const
struct
sock
*
sk
)
{
return
(
struct
raw_sock
*
)
sk
;
}
#endif
/* _ICMP_H */
#endif
/* _ICMP_H */
net/ipv4/raw.c
View file @
62343f76
...
@@ -135,7 +135,7 @@ static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb)
...
@@ -135,7 +135,7 @@ static __inline__ int icmp_filter(struct sock *sk, struct sk_buff *skb)
type
=
skb
->
h
.
icmph
->
type
;
type
=
skb
->
h
.
icmph
->
type
;
if
(
type
<
32
)
{
if
(
type
<
32
)
{
__u32
data
=
raw
4
_sk
(
sk
)
->
filter
.
data
;
__u32
data
=
raw_sk
(
sk
)
->
filter
.
data
;
return
((
1
<<
type
)
&
data
)
!=
0
;
return
((
1
<<
type
)
&
data
)
!=
0
;
}
}
...
@@ -615,9 +615,10 @@ out: return err ? err : copied;
...
@@ -615,9 +615,10 @@ out: return err ? err : copied;
static
int
raw_init
(
struct
sock
*
sk
)
static
int
raw_init
(
struct
sock
*
sk
)
{
{
struct
raw_opt
*
tp
=
raw4_sk
(
sk
);
struct
raw_sock
*
rp
=
raw_sk
(
sk
);
if
(
inet_sk
(
sk
)
->
num
==
IPPROTO_ICMP
)
if
(
inet_sk
(
sk
)
->
num
==
IPPROTO_ICMP
)
memset
(
&
tp
->
filter
,
0
,
sizeof
(
t
p
->
filter
));
memset
(
&
rp
->
filter
,
0
,
sizeof
(
r
p
->
filter
));
return
0
;
return
0
;
}
}
...
@@ -625,7 +626,7 @@ static int raw_seticmpfilter(struct sock *sk, char __user *optval, int optlen)
...
@@ -625,7 +626,7 @@ static int raw_seticmpfilter(struct sock *sk, char __user *optval, int optlen)
{
{
if
(
optlen
>
sizeof
(
struct
icmp_filter
))
if
(
optlen
>
sizeof
(
struct
icmp_filter
))
optlen
=
sizeof
(
struct
icmp_filter
);
optlen
=
sizeof
(
struct
icmp_filter
);
if
(
copy_from_user
(
&
raw
4
_sk
(
sk
)
->
filter
,
optval
,
optlen
))
if
(
copy_from_user
(
&
raw_sk
(
sk
)
->
filter
,
optval
,
optlen
))
return
-
EFAULT
;
return
-
EFAULT
;
return
0
;
return
0
;
}
}
...
@@ -643,7 +644,7 @@ static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *o
...
@@ -643,7 +644,7 @@ static int raw_geticmpfilter(struct sock *sk, char __user *optval, int __user *o
len
=
sizeof
(
struct
icmp_filter
);
len
=
sizeof
(
struct
icmp_filter
);
ret
=
-
EFAULT
;
ret
=
-
EFAULT
;
if
(
put_user
(
len
,
optlen
)
||
if
(
put_user
(
len
,
optlen
)
||
copy_to_user
(
optval
,
&
raw
4
_sk
(
sk
)
->
filter
,
len
))
copy_to_user
(
optval
,
&
raw_sk
(
sk
)
->
filter
,
len
))
goto
out
;
goto
out
;
ret
=
0
;
ret
=
0
;
out:
return
ret
;
out:
return
ret
;
...
...
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