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
021a7627
Commit
021a7627
authored
Apr 22, 2003
by
Hideaki Yoshifuji
Committed by
Arnaldo Carvalho de Melo
Apr 22, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6]: dst_alloc() clean-up.
parent
39b69c03
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
12 deletions
+14
-12
include/net/ip6_route.h
include/net/ip6_route.h
+1
-1
net/ipv6/ndisc.c
net/ipv6/ndisc.c
+3
-3
net/ipv6/route.c
net/ipv6/route.c
+10
-8
No files found.
include/net/ip6_route.h
View file @
021a7627
...
@@ -59,7 +59,7 @@ extern struct rt6_info *rt6_lookup(struct in6_addr *daddr,
...
@@ -59,7 +59,7 @@ extern struct rt6_info *rt6_lookup(struct in6_addr *daddr,
struct
in6_addr
*
saddr
,
struct
in6_addr
*
saddr
,
int
oif
,
int
flags
);
int
oif
,
int
flags
);
extern
struct
rt6_info
*
ndisc_get_dummy_rt
(
void
);
extern
struct
rt6_info
*
ip6_dst_alloc
(
void
);
/*
/*
* support functions for ND
* support functions for ND
...
...
net/ipv6/ndisc.c
View file @
021a7627
...
@@ -427,7 +427,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
...
@@ -427,7 +427,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
len
=
sizeof
(
struct
icmp6hdr
)
+
sizeof
(
struct
in6_addr
);
len
=
sizeof
(
struct
icmp6hdr
)
+
sizeof
(
struct
in6_addr
);
rt
=
ndisc_get_dummy_rt
();
rt
=
ip6_dst_alloc
();
if
(
!
rt
)
if
(
!
rt
)
return
;
return
;
...
@@ -524,7 +524,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
...
@@ -524,7 +524,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
saddr
=
&
addr_buf
;
saddr
=
&
addr_buf
;
}
}
rt
=
ndisc_get_dummy_rt
();
rt
=
ip6_dst_alloc
();
if
(
!
rt
)
if
(
!
rt
)
return
;
return
;
...
@@ -595,7 +595,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
...
@@ -595,7 +595,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
int
len
;
int
len
;
int
err
;
int
err
;
rt
=
ndisc_get_dummy_rt
();
rt
=
ip6_dst_alloc
();
if
(
!
rt
)
if
(
!
rt
)
return
;
return
;
...
...
net/ipv6/route.c
View file @
021a7627
...
@@ -130,12 +130,17 @@ struct fib6_node ip6_routing_table = {
...
@@ -130,12 +130,17 @@ struct fib6_node ip6_routing_table = {
rwlock_t
rt6_lock
=
RW_LOCK_UNLOCKED
;
rwlock_t
rt6_lock
=
RW_LOCK_UNLOCKED
;
/*
Dummy rt for ndisc
*/
/*
allocate dst with ip6_dst_ops
*/
st
ruct
rt6_info
*
ndisc_get_dummy_rt
(
)
st
atic
__inline__
struct
rt6_info
*
__ip6_dst_alloc
(
void
)
{
{
return
dst_alloc
(
&
ip6_dst_ops
);
return
dst_alloc
(
&
ip6_dst_ops
);
}
}
struct
rt6_info
*
ip6_dst_alloc
(
void
)
{
return
__ip6_dst_alloc
();
}
/*
/*
* Route lookup. Any rt6_lock is implied.
* Route lookup. Any rt6_lock is implied.
*/
*/
...
@@ -640,7 +645,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh)
...
@@ -640,7 +645,7 @@ int ip6_route_add(struct in6_rtmsg *rtmsg, struct nlmsghdr *nlh)
if
(
rtmsg
->
rtmsg_metric
==
0
)
if
(
rtmsg
->
rtmsg_metric
==
0
)
rtmsg
->
rtmsg_metric
=
IP6_RT_PRIO_USER
;
rtmsg
->
rtmsg_metric
=
IP6_RT_PRIO_USER
;
rt
=
dst_alloc
(
&
ip6_dst_ops
);
rt
=
__ip6_dst_alloc
(
);
if
(
rt
==
NULL
)
if
(
rt
==
NULL
)
return
-
ENOMEM
;
return
-
ENOMEM
;
...
@@ -1035,9 +1040,7 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
...
@@ -1035,9 +1040,7 @@ void rt6_pmtu_discovery(struct in6_addr *daddr, struct in6_addr *saddr,
static
struct
rt6_info
*
ip6_rt_copy
(
struct
rt6_info
*
ort
)
static
struct
rt6_info
*
ip6_rt_copy
(
struct
rt6_info
*
ort
)
{
{
struct
rt6_info
*
rt
;
struct
rt6_info
*
rt
=
__ip6_dst_alloc
();
rt
=
dst_alloc
(
&
ip6_dst_ops
);
if
(
rt
)
{
if
(
rt
)
{
rt
->
u
.
dst
.
input
=
ort
->
u
.
dst
.
input
;
rt
->
u
.
dst
.
input
=
ort
->
u
.
dst
.
input
;
...
@@ -1181,9 +1184,8 @@ int ip6_pkt_discard(struct sk_buff *skb)
...
@@ -1181,9 +1184,8 @@ int ip6_pkt_discard(struct sk_buff *skb)
int
ip6_rt_addr_add
(
struct
in6_addr
*
addr
,
struct
net_device
*
dev
)
int
ip6_rt_addr_add
(
struct
in6_addr
*
addr
,
struct
net_device
*
dev
)
{
{
struct
rt6_info
*
rt
;
struct
rt6_info
*
rt
=
__ip6_dst_alloc
()
;
rt
=
dst_alloc
(
&
ip6_dst_ops
);
if
(
rt
==
NULL
)
if
(
rt
==
NULL
)
return
-
ENOMEM
;
return
-
ENOMEM
;
...
...
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