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
3a5ad2ee
Commit
3a5ad2ee
authored
Jul 12, 2012
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ipv6: Add ip6_redirect() and ip6_sk_redirect() helper functions.
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
6e157b6a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
include/net/ip6_route.h
include/net/ip6_route.h
+2
-0
net/ipv6/route.c
net/ipv6/route.c
+27
-0
No files found.
include/net/ip6_route.h
View file @
3a5ad2ee
...
...
@@ -139,6 +139,8 @@ extern void ip6_update_pmtu(struct sk_buff *skb, struct net *net, __be32 mtu,
int
oif
,
u32
mark
);
extern
void
ip6_sk_update_pmtu
(
struct
sk_buff
*
skb
,
struct
sock
*
sk
,
__be32
mtu
);
extern
void
ip6_redirect
(
struct
sk_buff
*
skb
,
struct
net
*
net
,
int
oif
,
u32
mark
);
extern
void
ip6_sk_redirect
(
struct
sk_buff
*
skb
,
struct
sock
*
sk
);
struct
netlink_callback
;
...
...
net/ipv6/route.c
View file @
3a5ad2ee
...
...
@@ -1114,6 +1114,33 @@ void ip6_sk_update_pmtu(struct sk_buff *skb, struct sock *sk, __be32 mtu)
}
EXPORT_SYMBOL_GPL
(
ip6_sk_update_pmtu
);
void
ip6_redirect
(
struct
sk_buff
*
skb
,
struct
net
*
net
,
int
oif
,
u32
mark
)
{
const
struct
ipv6hdr
*
iph
=
(
struct
ipv6hdr
*
)
skb
->
data
;
struct
dst_entry
*
dst
;
struct
flowi6
fl6
;
memset
(
&
fl6
,
0
,
sizeof
(
fl6
));
fl6
.
flowi6_oif
=
oif
;
fl6
.
flowi6_mark
=
mark
;
fl6
.
flowi6_flags
=
0
;
fl6
.
daddr
=
iph
->
daddr
;
fl6
.
saddr
=
iph
->
saddr
;
fl6
.
flowlabel
=
(
*
(
__be32
*
)
iph
)
&
IPV6_FLOWINFO_MASK
;
dst
=
ip6_route_output
(
net
,
NULL
,
&
fl6
);
if
(
!
dst
->
error
)
rt6_do_redirect
(
dst
,
skb
);
dst_release
(
dst
);
}
EXPORT_SYMBOL_GPL
(
ip6_redirect
);
void
ip6_sk_redirect
(
struct
sk_buff
*
skb
,
struct
sock
*
sk
)
{
ip6_redirect
(
skb
,
sock_net
(
sk
),
sk
->
sk_bound_dev_if
,
sk
->
sk_mark
);
}
EXPORT_SYMBOL_GPL
(
ip6_sk_redirect
);
static
unsigned
int
ip6_default_advmss
(
const
struct
dst_entry
*
dst
)
{
struct
net_device
*
dev
=
dst
->
dev
;
...
...
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