struct interface *ifp = NULL;
struct prefix p;
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
- p.prefixlen = plen;
+ p.prefixlen = v4mapped(prefix) ? plen - 96 : plen;
if (p.family == AF_INET) {
uchar_to_inaddr(&p.u.prefix4, prefix);
} else {
struct interface *ifp = NULL;
struct prefix p;
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
- p.prefixlen = plen;
+ p.prefixlen = v4mapped(prefix) ? plen - 96 : plen;
if (p.family == AF_INET) {
uchar_to_inaddr(&p.u.prefix4, prefix);
} else {
struct interface *ifp = NULL;
struct prefix p;
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
- p.prefixlen = plen;
+ p.prefixlen = v4mapped(prefix) ? plen - 96 : plen;
if (p.family == AF_INET) {
uchar_to_inaddr(&p.u.prefix4, prefix);
} else {
inaddr_to_uchar(uchar_prefix, &prefix->prefix);
debugf(BABEL_DEBUG_ROUTE, "Adding new ipv4 route comming from Zebra.");
- xroute_add_new_route(uchar_prefix, prefix->prefixlen, api->metric, ifindex,
- 0, 1);
+ xroute_add_new_route(uchar_prefix, prefix->prefixlen + 96,
+ api->metric, ifindex, 0, 1);
return 0;
}
struct xroute *xroute = NULL;
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) {
debugf(BABEL_DEBUG_ROUTE, "Removing ipv4 route (from zebra).");
flush_xroute(xroute);