This commit is contained in:
水兵 2025-04-29 16:22:43 +00:00 committed by GitHub
commit 4d503670c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -587,6 +587,7 @@ interface_recalculate(struct interface *ifp)
int mtu, rc;
struct ipv6_mreq mreq;
babel_interface_nfo *babel_ifp = babel_get_if_nfo(ifp);
struct connected *connected;
assert (babel_ifp != NULL);
if (!IS_ENABLE(ifp))
@ -597,6 +598,14 @@ interface_recalculate(struct interface *ifp)
return -1;
}
babel_ifp->ipv4 = malloc(4);
frr_each (if_connected, ifp->connected, connected) {
if (connected->address->family == AF_INET) {
memcpy(babel_ifp->ipv4, &connected->address->u.prefix4, 4);
break;
}
}
SET_FLAG(babel_ifp->flags, BABEL_IF_IS_UP);
mtu = MIN(ifp->mtu, ifp->mtu6);