Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
fib: Use the VLIB logger for adjacency debugging
[vpp.git]
/
src
/
vnet
/
fib
/
fib_sas.c
diff --git
a/src/vnet/fib/fib_sas.c
b/src/vnet/fib/fib_sas.c
index
b607a0b
..
c9d4693
100644
(file)
--- a/
src/vnet/fib/fib_sas.c
+++ b/
src/vnet/fib/fib_sas.c
@@
-61,6
+61,18
@@
fib_sas4_get (u32 sw_if_index,
d_tmp.ip4 = *dst;
}
d_tmp.ip4 = *dst;
}
+ if (vnet_sw_interface_is_p2p(vnet_get_main(), sw_if_index))
+ {
+ ip4_address_t *ip4;
+ ip4 = ip_interface_get_first_ip (sw_if_index, 1);
+ if (ip4) {
+ src->as_u32 = ip4->as_u32;
+ return (true);
+ } else {
+ return (false);
+ }
+ }
+
/*
* If the interface is unnumbered then use the IP interface
*/
/*
* If the interface is unnumbered then use the IP interface
*/
@@
-100,12
+112,29
@@
fib_sas6_get (u32 sw_if_index,
/*
* if the dst is v6 and link local, use the source link local
*/
/*
* if the dst is v6 and link local, use the source link local
*/
- if (ip6_address_is_link_local_unicast (dst))
+ if (
dst &&
ip6_address_is_link_local_unicast (dst))
{
{
- ip6_address_copy (src, ip6_get_link_local_address (sw_if_index));
+ const ip6_address_t *ll = ip6_get_link_local_address (sw_if_index);
+ if (NULL == ll)
+ {
+ return (false);
+ }
+ ip6_address_copy (src, ll);
return (true);
}
return (true);
}
+ if (vnet_sw_interface_is_p2p(vnet_get_main(), sw_if_index))
+ {
+ ip6_address_t *ip6;
+ ip6 = ip_interface_get_first_ip (sw_if_index, 0);
+ if (ip6) {
+ ip6_address_copy(src, ip6);
+ return (true);
+ } else {
+ return (false);
+ }
+ }
+
/*
* get the source address from the glean adjacency
*/
/*
* get the source address from the glean adjacency
*/