mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 14:29:47 +00:00
babeld: fix bug due to v4mapped addresses.
This commit is contained in:
parent
f1305cbfbe
commit
6dfeb3f6cf
@ -708,7 +708,7 @@ input_filter(const unsigned char *id,
|
|||||||
struct interface *ifp = NULL;
|
struct interface *ifp = NULL;
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
|
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
|
||||||
p.prefixlen = plen;
|
p.prefixlen = v4mapped(prefix) ? plen - 96 : plen;
|
||||||
if (p.family == AF_INET) {
|
if (p.family == AF_INET) {
|
||||||
uchar_to_inaddr(&p.u.prefix4, prefix);
|
uchar_to_inaddr(&p.u.prefix4, prefix);
|
||||||
} else {
|
} else {
|
||||||
@ -730,7 +730,7 @@ output_filter(const unsigned char *id, const unsigned char *prefix,
|
|||||||
struct interface *ifp = NULL;
|
struct interface *ifp = NULL;
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
|
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
|
||||||
p.prefixlen = plen;
|
p.prefixlen = v4mapped(prefix) ? plen - 96 : plen;
|
||||||
if (p.family == AF_INET) {
|
if (p.family == AF_INET) {
|
||||||
uchar_to_inaddr(&p.u.prefix4, prefix);
|
uchar_to_inaddr(&p.u.prefix4, prefix);
|
||||||
} else {
|
} else {
|
||||||
@ -752,7 +752,7 @@ redistribute_filter(const unsigned char *prefix, unsigned short plen,
|
|||||||
struct interface *ifp = NULL;
|
struct interface *ifp = NULL;
|
||||||
struct prefix p;
|
struct prefix p;
|
||||||
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
|
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
|
||||||
p.prefixlen = plen;
|
p.prefixlen = v4mapped(prefix) ? plen - 96 : plen;
|
||||||
if (p.family == AF_INET) {
|
if (p.family == AF_INET) {
|
||||||
uchar_to_inaddr(&p.u.prefix4, prefix);
|
uchar_to_inaddr(&p.u.prefix4, prefix);
|
||||||
} else {
|
} else {
|
||||||
|
@ -63,8 +63,8 @@ babel_ipv4_route_add (struct zapi_ipv4 *api, struct prefix_ipv4 *prefix,
|
|||||||
|
|
||||||
inaddr_to_uchar(uchar_prefix, &prefix->prefix);
|
inaddr_to_uchar(uchar_prefix, &prefix->prefix);
|
||||||
debugf(BABEL_DEBUG_ROUTE, "Adding new ipv4 route comming from Zebra.");
|
debugf(BABEL_DEBUG_ROUTE, "Adding new ipv4 route comming from Zebra.");
|
||||||
xroute_add_new_route(uchar_prefix, prefix->prefixlen, api->metric, ifindex,
|
xroute_add_new_route(uchar_prefix, prefix->prefixlen + 96,
|
||||||
0, 1);
|
api->metric, ifindex, 0, 1);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ babel_ipv4_route_delete (struct zapi_ipv4 *api, struct prefix_ipv4 *prefix,
|
|||||||
struct xroute *xroute = NULL;
|
struct xroute *xroute = NULL;
|
||||||
|
|
||||||
inaddr_to_uchar(uchar_prefix, &prefix->prefix);
|
inaddr_to_uchar(uchar_prefix, &prefix->prefix);
|
||||||
xroute = find_xroute(uchar_prefix, prefix->prefixlen);
|
xroute = find_xroute(uchar_prefix, prefix->prefixlen + 96);
|
||||||
if (xroute != NULL) {
|
if (xroute != NULL) {
|
||||||
debugf(BABEL_DEBUG_ROUTE, "Removing ipv4 route (from zebra).");
|
debugf(BABEL_DEBUG_ROUTE, "Removing ipv4 route (from zebra).");
|
||||||
flush_xroute(xroute);
|
flush_xroute(xroute);
|
||||||
|
Loading…
Reference in New Issue
Block a user