mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 13:27:53 +00:00
ripd: considering a interface with 2 or more IP
This commit fixes these three issues: 1) rinfo is used for rip packet sending not tmp_rinfo 2) With RIP_SPLIT_HORIZON and an interface with more than 1 ip addresses we will not send the routes out an interface that they originate on 3) With RIP_SPLIT_HORIZON_POISONED_REVERSE and an interface with more than 1 ip address we will not send out ipA with a metric of 16 and ipb with a metric of 1. Both will be 16 now. Signed-off-by: lyq140 <34637052+lyq140@users.noreply.github.com>
This commit is contained in:
parent
1af416bc25
commit
9920df072a
36
ripd/ripd.c
36
ripd/ripd.c
@ -2186,6 +2186,7 @@ void rip_output_process(struct connected *ifc, struct sockaddr_in *to,
|
|||||||
*/
|
*/
|
||||||
int suppress = 0;
|
int suppress = 0;
|
||||||
struct rip_info *tmp_rinfo = NULL;
|
struct rip_info *tmp_rinfo = NULL;
|
||||||
|
struct connected *tmp_ifc = NULL;
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(list, listnode,
|
for (ALL_LIST_ELEMENTS_RO(list, listnode,
|
||||||
tmp_rinfo))
|
tmp_rinfo))
|
||||||
@ -2197,10 +2198,17 @@ void rip_output_process(struct connected *ifc, struct sockaddr_in *to,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!suppress
|
if (!suppress
|
||||||
&& rinfo->type == ZEBRA_ROUTE_CONNECT
|
&& rinfo->type == ZEBRA_ROUTE_CONNECT) {
|
||||||
&& prefix_match((struct prefix *)p,
|
for (ALL_LIST_ELEMENTS_RO(
|
||||||
ifc->address))
|
ifc->ifp->connected,
|
||||||
suppress = 1;
|
listnode, tmp_ifc))
|
||||||
|
if (prefix_match(
|
||||||
|
(struct prefix *)p,
|
||||||
|
tmp_ifc->address)) {
|
||||||
|
suppress = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (suppress)
|
if (suppress)
|
||||||
continue;
|
continue;
|
||||||
@ -2311,19 +2319,29 @@ void rip_output_process(struct connected *ifc, struct sockaddr_in *to,
|
|||||||
* configured on the same interface).
|
* configured on the same interface).
|
||||||
*/
|
*/
|
||||||
struct rip_info *tmp_rinfo = NULL;
|
struct rip_info *tmp_rinfo = NULL;
|
||||||
|
struct connected *tmp_ifc = NULL;
|
||||||
|
|
||||||
for (ALL_LIST_ELEMENTS_RO(list, listnode,
|
for (ALL_LIST_ELEMENTS_RO(list, listnode,
|
||||||
tmp_rinfo))
|
tmp_rinfo))
|
||||||
if (tmp_rinfo->type == ZEBRA_ROUTE_RIP
|
if (tmp_rinfo->type == ZEBRA_ROUTE_RIP
|
||||||
&& tmp_rinfo->nh.ifindex
|
&& tmp_rinfo->nh.ifindex
|
||||||
== ifc->ifp->ifindex)
|
== ifc->ifp->ifindex)
|
||||||
tmp_rinfo->metric_out =
|
rinfo->metric_out =
|
||||||
RIP_METRIC_INFINITY;
|
RIP_METRIC_INFINITY;
|
||||||
|
|
||||||
if (rinfo->type == ZEBRA_ROUTE_CONNECT
|
if (rinfo->metric_out != RIP_METRIC_INFINITY
|
||||||
&& prefix_match((struct prefix *)p,
|
&& rinfo->type == ZEBRA_ROUTE_CONNECT) {
|
||||||
ifc->address))
|
for (ALL_LIST_ELEMENTS_RO(
|
||||||
rinfo->metric_out = RIP_METRIC_INFINITY;
|
ifc->ifp->connected,
|
||||||
|
listnode, tmp_ifc))
|
||||||
|
if (prefix_match(
|
||||||
|
(struct prefix *)p,
|
||||||
|
tmp_ifc->address)) {
|
||||||
|
rinfo->metric_out =
|
||||||
|
RIP_METRIC_INFINITY;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Prepare preamble, auth headers, if needs be */
|
/* Prepare preamble, auth headers, if needs be */
|
||||||
|
Loading…
Reference in New Issue
Block a user