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
0f052693
Commit
0f052693
authored
Feb 11, 2004
by
David Stevens
Committed by
David S. Miller
Feb 11, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6]: Except MLD packets from source filtering.
Co-authored with Yoshfuji Hideaki.
parent
297aeda7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
15 deletions
+48
-15
include/net/addrconf.h
include/net/addrconf.h
+1
-0
net/ipv6/ip6_input.c
net/ipv6/ip6_input.c
+19
-14
net/ipv6/mcast.c
net/ipv6/mcast.c
+28
-1
No files found.
include/net/addrconf.h
View file @
0f052693
...
...
@@ -98,6 +98,7 @@ extern void addrconf_dad_failure(struct inet6_ifaddr *ifp);
extern
int
ipv6_chk_mcast_addr
(
struct
net_device
*
dev
,
struct
in6_addr
*
group
,
struct
in6_addr
*
src_addr
);
extern
int
ipv6_is_mld
(
struct
sk_buff
*
skb
,
int
nexthdr
);
extern
void
addrconf_prefix_rcv
(
struct
net_device
*
dev
,
u8
*
opt
,
int
len
);
...
...
net/ipv6/ip6_input.c
View file @
0f052693
...
...
@@ -168,11 +168,19 @@ static inline int ip6_input_finish(struct sk_buff *skb)
smp_read_barrier_depends
();
if
(
ipprot
->
flags
&
INET6_PROTO_FINAL
)
{
struct
ipv6hdr
*
hdr
;
if
(
!
cksum_sub
&&
skb
->
ip_summed
==
CHECKSUM_HW
)
{
skb
->
csum
=
csum_sub
(
skb
->
csum
,
csum_partial
(
skb
->
nh
.
raw
,
skb
->
h
.
raw
-
skb
->
nh
.
raw
,
0
));
cksum_sub
++
;
}
hdr
=
skb
->
nh
.
ipv6h
;
if
(
ipv6_addr_is_multicast
(
&
hdr
->
daddr
)
&&
!
ipv6_chk_mcast_addr
(
skb
->
dev
,
&
hdr
->
daddr
,
&
hdr
->
saddr
)
&&
!
ipv6_is_mld
(
skb
,
nexthdr
))
goto
discard
;
}
if
(
!
(
ipprot
->
flags
&
INET6_PROTO_NOPOLICY
)
&&
!
xfrm6_policy_check
(
NULL
,
XFRM_POLICY_IN
,
skb
))
...
...
@@ -212,14 +220,13 @@ int ip6_input(struct sk_buff *skb)
int
ip6_mc_input
(
struct
sk_buff
*
skb
)
{
struct
ipv6hdr
*
hdr
;
int
deliver
=
0
;
int
discard
=
1
;
int
deliver
;
IP6_INC_STATS_BH
(
Ip6InMcastPkts
);
hdr
=
skb
->
nh
.
ipv6h
;
if
(
ipv6_chk_mcast_addr
(
skb
->
dev
,
&
hdr
->
daddr
,
&
hdr
->
saddr
))
deliver
=
1
;
deliver
=
likely
(
!
(
skb
->
dev
->
flags
&
(
IFF_PROMISC
|
IFF_ALLMULTI
)))
||
ipv6_chk_mcast_addr
(
skb
->
dev
,
&
hdr
->
daddr
,
NULL
)
;
/*
* IPv6 multicast router mode isnt currently supported.
...
...
@@ -238,22 +245,20 @@ int ip6_mc_input(struct sk_buff *skb)
if (deliver) {
skb2 = skb_clone(skb, GFP_ATOMIC);
dst_output(skb2);
} else {
d
iscard = 0
;
skb2 = skb
;
d
st_output(skb)
;
return 0
;
}
dst_output(skb2);
}
}
#endif
if
(
deliver
)
{
discard
=
0
;
if
(
likely
(
deliver
))
{
ip6_input
(
skb
);
return
0
;
}
if
(
discard
)
/* discard */
kfree_skb
(
skb
);
return
0
;
...
...
net/ipv6/mcast.c
View file @
0f052693
...
...
@@ -900,6 +900,33 @@ int ipv6_dev_mc_dec(struct net_device *dev, struct in6_addr *addr)
return
err
;
}
/*
* identify MLD packets for MLD filter exceptions
*/
int
ipv6_is_mld
(
struct
sk_buff
*
skb
,
int
nexthdr
)
{
struct
icmp6hdr
*
pic
;
if
(
nexthdr
!=
IPPROTO_ICMPV6
)
return
0
;
if
(
!
pskb_may_pull
(
skb
,
sizeof
(
struct
icmp6hdr
)))
return
0
;
pic
=
(
struct
icmp6hdr
*
)
skb
->
h
.
raw
;
switch
(
pic
->
icmp6_type
)
{
case
ICMPV6_MGM_QUERY
:
case
ICMPV6_MGM_REPORT
:
case
ICMPV6_MGM_REDUCTION
:
case
ICMPV6_MLD2_REPORT
:
return
1
;
default:
break
;
}
return
0
;
}
/*
* check if the interface/address pair is valid
*/
...
...
@@ -918,7 +945,7 @@ int ipv6_chk_mcast_addr(struct net_device *dev, struct in6_addr *group,
break
;
}
if
(
mc
)
{
if
(
!
ipv6_addr_any
(
src_addr
))
{
if
(
src_addr
&&
!
ipv6_addr_any
(
src_addr
))
{
struct
ip6_sf_list
*
psf
;
spin_lock_bh
(
&
mc
->
mca_lock
);
...
...
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