lib: Make distribute.c accepts both v4 and v6.
distribute.c doesn't allow to manage both v4 and v6 distribute lists. This
patch fix this problem by having 4 DISTRIBUTE* values in the enumeration instead
of two. The code in all daemons using distribute.c is adapted.
diff --git a/ripd/ripd.c b/ripd/ripd.c
index 990db60..385dab9 100644
--- a/ripd/ripd.c
+++ b/ripd/ripd.c
@@ -321,7 +321,7 @@
struct access_list *alist;
struct prefix_list *plist;
int distribute = rip_distribute == RIP_FILTER_OUT ?
- DISTRIBUTE_OUT : DISTRIBUTE_IN;
+ DISTRIBUTE_V4_OUT : DISTRIBUTE_V4_IN;
const char *inout = rip_distribute == RIP_FILTER_OUT ? "out" : "in";
/* Input distribute-list filtering. */
@@ -3799,9 +3799,9 @@
ri = ifp->info;
- if (dist->list[DISTRIBUTE_IN])
+ if (dist->list[DISTRIBUTE_V4_IN])
{
- alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_IN]);
+ alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_IN]);
if (alist)
ri->list[RIP_FILTER_IN] = alist;
else
@@ -3810,9 +3810,9 @@
else
ri->list[RIP_FILTER_IN] = NULL;
- if (dist->list[DISTRIBUTE_OUT])
+ if (dist->list[DISTRIBUTE_V4_OUT])
{
- alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_OUT]);
+ alist = access_list_lookup (AFI_IP, dist->list[DISTRIBUTE_V4_OUT]);
if (alist)
ri->list[RIP_FILTER_OUT] = alist;
else
@@ -3821,9 +3821,9 @@
else
ri->list[RIP_FILTER_OUT] = NULL;
- if (dist->prefix[DISTRIBUTE_IN])
+ if (dist->prefix[DISTRIBUTE_V4_IN])
{
- plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_IN]);
+ plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_V4_IN]);
if (plist)
ri->prefix[RIP_FILTER_IN] = plist;
else
@@ -3832,9 +3832,9 @@
else
ri->prefix[RIP_FILTER_IN] = NULL;
- if (dist->prefix[DISTRIBUTE_OUT])
+ if (dist->prefix[DISTRIBUTE_V4_OUT])
{
- plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_OUT]);
+ plist = prefix_list_lookup (AFI_IP, dist->prefix[DISTRIBUTE_V4_OUT]);
if (plist)
ri->prefix[RIP_FILTER_OUT] = plist;
else