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
bae8829b
Commit
bae8829b
authored
May 27, 2003
by
Hideaki Yoshifuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6]: Clean up ip6_dst_alloc() calls.
parent
8a15a6c8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
23 deletions
+18
-23
net/ipv6/ndisc.c
net/ipv6/ndisc.c
+18
-23
No files found.
net/ipv6/ndisc.c
View file @
bae8829b
...
...
@@ -389,9 +389,14 @@ int ndisc_output(struct sk_buff *skb)
return
-
EINVAL
;
}
static
inline
void
ndisc_rt_init
(
struct
rt6_info
*
rt
,
struct
net_device
*
dev
,
static
inline
struct
dst_entry
*
ndisc_dst_alloc
(
struct
net_device
*
dev
,
struct
neighbour
*
neigh
)
{
struct
rt6_info
*
rt
=
ip6_dst_alloc
();
if
(
unlikely
(
rt
==
NULL
))
goto
out
;
rt
->
rt6i_dev
=
dev
;
rt
->
rt6i_nexthop
=
neigh
;
rt
->
rt6i_expires
=
0
;
...
...
@@ -399,6 +404,8 @@ static inline void ndisc_rt_init(struct rt6_info *rt, struct net_device *dev,
rt
->
rt6i_metric
=
0
;
rt
->
u
.
dst
.
metrics
[
RTAX_HOPLIMIT
-
1
]
=
255
;
rt
->
u
.
dst
.
output
=
ndisc_output
;
out:
return
(
struct
dst_entry
*
)
rt
;
}
static
inline
void
ndisc_flow_init
(
struct
flowi
*
fl
,
u8
type
,
...
...
@@ -420,7 +427,6 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
struct
inet6_ifaddr
*
ifp
;
struct
inet6_dev
*
idev
;
struct
flowi
fl
;
struct
rt6_info
*
rt
=
NULL
;
struct
dst_entry
*
dst
;
struct
sock
*
sk
=
ndisc_socket
->
sk
;
struct
in6_addr
*
src_addr
;
...
...
@@ -442,14 +448,11 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
src_addr
=
&
tmpaddr
;
}
rt
=
ip6_dst_alloc
();
if
(
!
rt
)
return
;
ndisc_flow_init
(
&
fl
,
NDISC_NEIGHBOUR_ADVERTISEMENT
,
src_addr
,
daddr
);
ndisc_rt_init
(
rt
,
dev
,
neigh
);
dst
=
(
struct
dst_entry
*
)
rt
;
dst
=
ndisc_dst_alloc
(
dev
,
neigh
);
if
(
!
dst
)
return
;
err
=
xfrm_lookup
(
&
dst
,
&
fl
,
NULL
,
0
);
if
(
err
<
0
)
{
...
...
@@ -516,7 +519,6 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
struct
in6_addr
*
daddr
,
struct
in6_addr
*
saddr
)
{
struct
flowi
fl
;
struct
rt6_info
*
rt
=
NULL
;
struct
dst_entry
*
dst
;
struct
inet6_dev
*
idev
;
struct
sock
*
sk
=
ndisc_socket
->
sk
;
...
...
@@ -533,14 +535,11 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
saddr
=
&
addr_buf
;
}
rt
=
ip6_dst_alloc
();
if
(
!
rt
)
return
;
ndisc_flow_init
(
&
fl
,
NDISC_NEIGHBOUR_SOLICITATION
,
saddr
,
daddr
);
ndisc_rt_init
(
rt
,
dev
,
neigh
);
dst
=
(
struct
dst_entry
*
)
rt
;
dst
=
ndisc_dst_alloc
(
dev
,
neigh
);
if
(
!
dst
)
return
;
dst_clone
(
dst
);
err
=
xfrm_lookup
(
&
dst
,
&
fl
,
NULL
,
0
);
...
...
@@ -599,7 +598,6 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
struct
in6_addr
*
daddr
)
{
struct
flowi
fl
;
struct
rt6_info
*
rt
=
NULL
;
struct
dst_entry
*
dst
;
struct
inet6_dev
*
idev
;
struct
sock
*
sk
=
ndisc_socket
->
sk
;
...
...
@@ -609,14 +607,11 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
int
len
;
int
err
;
rt
=
ip6_dst_alloc
();
if
(
!
rt
)
return
;
ndisc_flow_init
(
&
fl
,
NDISC_ROUTER_SOLICITATION
,
saddr
,
daddr
);
ndisc_rt_init
(
rt
,
dev
,
NULL
);
dst
=
(
struct
dst_entry
*
)
rt
;
dst
=
ndisc_dst_alloc
(
dev
,
NULL
);
if
(
!
dst
)
return
;
dst_clone
(
dst
);
err
=
xfrm_lookup
(
&
dst
,
&
fl
,
NULL
,
0
);
...
...
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