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
68f80838
Commit
68f80838
authored
Oct 24, 2002
by
Alexey Kuznetsov
Committed by
Hideaki Yoshifuji
Oct 24, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV4]: Rework key route lookup interface slightly.
parent
5235d77d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
10 deletions
+26
-10
include/net/route.h
include/net/route.h
+11
-8
net/ipv4/route.c
net/ipv4/route.c
+15
-2
No files found.
include/net/route.h
View file @
68f80838
...
...
@@ -112,7 +112,8 @@ extern void ip_rt_redirect(u32 old_gw, u32 dst, u32 new_gw,
u32
src
,
u8
tos
,
struct
net_device
*
dev
);
extern
void
ip_rt_advice
(
struct
rtable
**
rp
,
int
advice
);
extern
void
rt_cache_flush
(
int
how
);
extern
int
ip_route_output_key
(
struct
rtable
**
,
const
struct
flowi
*
flp
);
extern
int
__ip_route_output_key
(
struct
rtable
**
,
const
struct
flowi
*
flp
);
extern
int
ip_route_output_key
(
struct
rtable
**
,
struct
flowi
*
flp
);
extern
int
ip_route_input
(
struct
sk_buff
*
,
u32
dst
,
u32
src
,
u8
tos
,
struct
net_device
*
devin
);
extern
unsigned
short
ip_rt_frag_needed
(
struct
iphdr
*
iph
,
unsigned
short
new_mtu
);
extern
void
ip_rt_send_redirect
(
struct
sk_buff
*
skb
);
...
...
@@ -150,13 +151,15 @@ static inline int ip_route_connect(struct rtable **rp, u32 dst, u32 src, u32 tos
.
dport
=
dport
}
}
};
int
err
;
err
=
ip_route_output_key
(
rp
,
&
fl
);
if
(
err
||
(
dst
&&
src
))
return
err
;
fl
.
fl4_dst
=
(
*
rp
)
->
rt_dst
;
fl
.
fl4_src
=
(
*
rp
)
->
rt_src
;
ip_rt_put
(
*
rp
);
*
rp
=
NULL
;
if
(
!
dst
||
!
src
)
{
err
=
__ip_route_output_key
(
rp
,
&
fl
);
if
(
err
)
return
err
;
fl
.
fl4_dst
=
(
*
rp
)
->
rt_dst
;
fl
.
fl4_src
=
(
*
rp
)
->
rt_src
;
ip_rt_put
(
*
rp
);
*
rp
=
NULL
;
}
return
ip_route_output_key
(
rp
,
&
fl
);
}
...
...
net/ipv4/route.c
View file @
68f80838
...
...
@@ -1993,7 +1993,7 @@ out: return err;
goto
done
;
}
int
ip_route_output_key
(
struct
rtable
**
rp
,
const
struct
flowi
*
flp
)
int
__
ip_route_output_key
(
struct
rtable
**
rp
,
const
struct
flowi
*
flp
)
{
unsigned
hash
;
struct
rtable
*
rth
;
...
...
@@ -2023,7 +2023,20 @@ int ip_route_output_key(struct rtable **rp, const struct flowi *flp)
read_unlock_bh
(
&
rt_hash_table
[
hash
].
lock
);
return
ip_route_output_slow
(
rp
,
flp
);
}
}
int
ip_route_output_key
(
struct
rtable
**
rp
,
struct
flowi
*
flp
)
{
int
err
;
if
((
err
=
__ip_route_output_key
(
rp
,
flp
))
!=
0
)
return
err
;
#if 0
return flp->proto ? xfrm_lookup((struct dst_entry**)rp, flp, NULL, 0) : 0;
#else
return
0
;
#endif
}
static
int
rt_fill_info
(
struct
sk_buff
*
skb
,
u32
pid
,
u32
seq
,
int
event
,
int
nowait
)
...
...
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