mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-03 23:25:34 +00:00
Merge pull request #12740 from vfreex/babel-fix-filtering
babeld: Fix filtering against all interfaces
This commit is contained in:
commit
d83c36ee44
@ -44,15 +44,18 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen,
|
|||||||
struct prefix_list *plist;
|
struct prefix_list *plist;
|
||||||
int distribute;
|
int distribute;
|
||||||
struct babel *babel;
|
struct babel *babel;
|
||||||
|
afi_t family;
|
||||||
|
|
||||||
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
|
p.family = v4mapped(prefix) ? AF_INET : AF_INET6;
|
||||||
p.prefixlen = v4mapped(prefix) ? plen - 96 : 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);
|
||||||
distribute = output ? DISTRIBUTE_V4_OUT : DISTRIBUTE_V4_IN;
|
distribute = output ? DISTRIBUTE_V4_OUT : DISTRIBUTE_V4_IN;
|
||||||
|
family = AFI_IP;
|
||||||
} else {
|
} else {
|
||||||
uchar_to_in6addr(&p.u.prefix6, prefix);
|
uchar_to_in6addr(&p.u.prefix6, prefix);
|
||||||
distribute = output ? DISTRIBUTE_V6_OUT : DISTRIBUTE_V6_IN;
|
distribute = output ? DISTRIBUTE_V6_OUT : DISTRIBUTE_V6_IN;
|
||||||
|
family = AFI_IP6;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (babel_ifp != NULL && babel_ifp->list[distribute]) {
|
if (babel_ifp != NULL && babel_ifp->list[distribute]) {
|
||||||
@ -79,7 +82,7 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen,
|
|||||||
dist = distribute_lookup (babel->distribute_ctx, NULL);
|
dist = distribute_lookup (babel->distribute_ctx, NULL);
|
||||||
if (dist) {
|
if (dist) {
|
||||||
if (dist->list[distribute]) {
|
if (dist->list[distribute]) {
|
||||||
alist = access_list_lookup (p.family, dist->list[distribute]);
|
alist = access_list_lookup (family, dist->list[distribute]);
|
||||||
|
|
||||||
if (alist) {
|
if (alist) {
|
||||||
if (access_list_apply (alist, &p) == FILTER_DENY) {
|
if (access_list_apply (alist, &p) == FILTER_DENY) {
|
||||||
@ -90,7 +93,7 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dist->prefix[distribute]) {
|
if (dist->prefix[distribute]) {
|
||||||
plist = prefix_list_lookup (p.family, dist->prefix[distribute]);
|
plist = prefix_list_lookup (family, dist->prefix[distribute]);
|
||||||
if (plist) {
|
if (plist) {
|
||||||
if (prefix_list_apply (plist, &p) == PREFIX_DENY) {
|
if (prefix_list_apply (plist, &p) == PREFIX_DENY) {
|
||||||
debugf(BABEL_DEBUG_FILTER,"%pFX filtered by distribute %s",
|
debugf(BABEL_DEBUG_FILTER,"%pFX filtered by distribute %s",
|
||||||
|
Loading…
Reference in New Issue
Block a user