
boutier at pps
Jul 20, 2012, 9:30 AM
Post #1 of 1
(106 views)
Permalink
|
|
[PATCH 5/5] lib: Make distribute.c accepts both v4 and v6.
|
|
From: Matthieu Boutier <boutier [at] pps> 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. --- babeld/babel_filter.c | 9 +- babeld/babeld.c | 4 +- lib/distribute.c | 295 +++++++++++++++++++++++++++++++++++++++++--------- lib/distribute.h | 6 +- ripd/ripd.c | 18 +-- ripngd/ripngd.c | 18 +-- 6 files changed, 276 insertions(+), 74 deletions(-) diff --git a/babeld/babel_filter.c b/babeld/babel_filter.c index 6e97e0e..6271087 100644 --- a/babeld/babel_filter.c +++ b/babeld/babel_filter.c @@ -38,14 +38,17 @@ babel_filter(int output, const unsigned char *prefix, unsigned short plen, struct distribute *dist; struct access_list *alist; struct prefix_list *plist; - int distribute = output ? DISTRIBUTE_OUT : DISTRIBUTE_IN; + int distribute; p.family = v4mapped(prefix) ? AF_INET : AF_INET6; p.prefixlen = v4mapped(prefix) ? plen - 96 : plen; - if (p.family == AF_INET) + if (p.family == AF_INET) { uchar_to_inaddr(&p.u.prefix4, prefix); - else + distribute = output ? DISTRIBUTE_V4_OUT : DISTRIBUTE_V4_IN; + } else { uchar_to_in6addr(&p.u.prefix6, prefix); + distribute = output ? DISTRIBUTE_V6_OUT : DISTRIBUTE_V6_IN; + } if (babel_ifp != NULL && babel_ifp->list[distribute]) { if (access_list_apply (babel_ifp->list[distribute], &p) diff --git a/babeld/babeld.c b/babeld/babeld.c index e99800e..38101fb 100644 --- a/babeld/babeld.c +++ b/babeld/babeld.c @@ -537,7 +537,7 @@ babel_distribute_update (struct distribute *dist) struct interface *ifp; babel_interface_nfo *babel_ifp; int type; - int family = AFI_IP6; + int family; if (! dist->ifname) return; @@ -549,6 +549,8 @@ babel_distribute_update (struct distribute *dist) babel_ifp = babel_get_if_nfo(ifp); for (type = 0; type < DISTRIBUTE_MAX; type++) { + family = type == DISTRIBUTE_V4_IN || type == DISTRIBUTE_V4_OUT ? + AFI_IP : AFI_IP6; if (dist->list[type]) babel_ifp->list[type] = access_list_lookup (family, dist->list[type]); diff --git a/lib/distribute.c b/lib/distribute.c index 37bf881..e137ec1 100644 --- a/lib/distribute.c +++ b/lib/distribute.c @@ -251,9 +251,9 @@ DEFUN (distribute_list_all, /* Check of distribute list type. */ if (strncmp (argv[1], "i", 1) == 0) - type = DISTRIBUTE_IN; + type = DISTRIBUTE_V4_IN; else if (strncmp (argv[1], "o", 1) == 0) - type = DISTRIBUTE_OUT; + type = DISTRIBUTE_V4_OUT; else { vty_out (vty, "distribute list direction must be [in|out]%s", @@ -267,13 +267,34 @@ DEFUN (distribute_list_all, return CMD_SUCCESS; } -ALIAS (distribute_list_all, +DEFUN (ipv6_distribute_list_all, ipv6_distribute_list_all_cmd, - "distribute-list WORD (in|out)", + "ipv6 distribute-list WORD (in|out)", "Filter networks in routing updates\n" "Access-list name\n" "Filter incoming routing updates\n" "Filter outgoing routing updates\n") +{ + enum distribute_type type; + + /* Check of distribute list type. */ + if (strncmp (argv[1], "i", 1) == 0) + type = DISTRIBUTE_V6_IN; + else if (strncmp (argv[1], "o", 1) == 0) + type = DISTRIBUTE_V6_OUT; + else + { + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + /* Get interface name corresponding distribute list. */ + distribute_list_set (NULL, type, argv[0]); + + return CMD_SUCCESS; +} + DEFUN (no_distribute_list_all, no_distribute_list_all_cmd, @@ -289,9 +310,9 @@ DEFUN (no_distribute_list_all, /* Check of distribute list type. */ if (strncmp (argv[1], "i", 1) == 0) - type = DISTRIBUTE_IN; + type = DISTRIBUTE_V4_IN; else if (strncmp (argv[1], "o", 1) == 0) - type = DISTRIBUTE_OUT; + type = DISTRIBUTE_V4_OUT; else { vty_out (vty, "distribute list direction must be [in|out]%s", @@ -308,14 +329,38 @@ DEFUN (no_distribute_list_all, return CMD_SUCCESS; } -ALIAS (no_distribute_list_all, +DEFUN (no_ipv6_distribute_list_all, no_ipv6_distribute_list_all_cmd, - "no distribute-list WORD (in|out)", + "no ipv6 distribute-list WORD (in|out)", NO_STR "Filter networks in routing updates\n" "Access-list name\n" "Filter incoming routing updates\n" "Filter outgoing routing updates\n") +{ + int ret; + enum distribute_type type; + + /* Check of distribute list type. */ + if (strncmp (argv[1], "i", 1) == 0) + type = DISTRIBUTE_V6_IN; + else if (strncmp (argv[1], "o", 1) == 0) + type = DISTRIBUTE_V6_OUT; + else + { + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + ret = distribute_list_unset (NULL, type, argv[0]); + if (! ret) + { + vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} DEFUN (distribute_list, distribute_list_cmd, @@ -330,9 +375,9 @@ DEFUN (distribute_list, /* Check of distribute list type. */ if (strncmp (argv[1], "i", 1) == 0) - type = DISTRIBUTE_IN; + type = DISTRIBUTE_V4_IN; else if (strncmp (argv[1], "o", 1) == 0) - type = DISTRIBUTE_OUT; + type = DISTRIBUTE_V4_OUT; else { vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); @@ -345,14 +390,33 @@ DEFUN (distribute_list, return CMD_SUCCESS; } -ALIAS (distribute_list, +DEFUN (ipv6_distribute_list, ipv6_distribute_list_cmd, - "distribute-list WORD (in|out) WORD", + "ipv6 distribute-list WORD (in|out) WORD", "Filter networks in routing updates\n" "Access-list name\n" "Filter incoming routing updates\n" "Filter outgoing routing updates\n" "Interface name\n") +{ + enum distribute_type type; + + /* Check of distribute list type. */ + if (strncmp (argv[1], "i", 1) == 0) + type = DISTRIBUTE_V6_IN; + else if (strncmp (argv[1], "o", 1) == 0) + type = DISTRIBUTE_V6_OUT; + else + { + vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); + return CMD_WARNING; + } + + /* Get interface name corresponding distribute list. */ + distribute_list_set (argv[2], type, argv[0]); + + return CMD_SUCCESS; +} DEFUN (no_distribute_list, no_distribute_list_cmd, "no distribute-list WORD (in|out) WORD", @@ -368,9 +432,9 @@ DEFUN (no_distribute_list, no_distribute_list_cmd, /* Check of distribute list type. */ if (strncmp (argv[1], "i", 1) == 0) - type = DISTRIBUTE_IN; + type = DISTRIBUTE_V4_IN; else if (strncmp (argv[1], "o", 1) == 0) - type = DISTRIBUTE_OUT; + type = DISTRIBUTE_V4_OUT; else { vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); @@ -386,14 +450,38 @@ DEFUN (no_distribute_list, no_distribute_list_cmd, return CMD_SUCCESS; } -ALIAS (no_distribute_list, no_ipv6_distribute_list_cmd, - "no distribute-list WORD (in|out) WORD", +DEFUN (no_ipv6_distribute_list, + no_ipv6_distribute_list_cmd, + "no ipv6 distribute-list WORD (in|out) WORD", NO_STR "Filter networks in routing updates\n" "Access-list name\n" "Filter incoming routing updates\n" "Filter outgoing routing updates\n" "Interface name\n") +{ + int ret; + enum distribute_type type; + + /* Check of distribute list type. */ + if (strncmp (argv[1], "i", 1) == 0) + type = DISTRIBUTE_V6_IN; + else if (strncmp (argv[1], "o", 1) == 0) + type = DISTRIBUTE_V6_OUT; + else + { + vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); + return CMD_WARNING; + } + + ret = distribute_list_unset (argv[2], type, argv[0]); + if (! ret) + { + vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} DEFUN (distribute_list_prefix_all, distribute_list_prefix_all_cmd, @@ -408,12 +496,12 @@ DEFUN (distribute_list_prefix_all, /* Check of distribute list type. */ if (strncmp (argv[1], "i", 1) == 0) - type = DISTRIBUTE_IN; + type = DISTRIBUTE_V4_IN; else if (strncmp (argv[1], "o", 1) == 0) - type = DISTRIBUTE_OUT; + type = DISTRIBUTE_V4_OUT; else { - vty_out (vty, "distribute list direction must be [in|out]%s", + vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); return CMD_WARNING; } @@ -424,14 +512,34 @@ DEFUN (distribute_list_prefix_all, return CMD_SUCCESS; } -ALIAS (distribute_list_prefix_all, +DEFUN (ipv6_distribute_list_prefix_all, ipv6_distribute_list_prefix_all_cmd, - "distribute-list prefix WORD (in|out)", + "ipv6 distribute-list prefix WORD (in|out)", "Filter networks in routing updates\n" "Filter prefixes in routing updates\n" "Name of an IP prefix-list\n" "Filter incoming routing updates\n" "Filter outgoing routing updates\n") +{ + enum distribute_type type; + + /* Check of distribute list type. */ + if (strncmp (argv[1], "i", 1) == 0) + type = DISTRIBUTE_V6_IN; + else if (strncmp (argv[1], "o", 1) == 0) + type = DISTRIBUTE_V6_OUT; + else + { + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + /* Get interface name corresponding distribute list. */ + distribute_list_prefix_set (NULL, type, argv[0]); + + return CMD_SUCCESS; +} DEFUN (no_distribute_list_prefix_all, no_distribute_list_prefix_all_cmd, @@ -448,12 +556,12 @@ DEFUN (no_distribute_list_prefix_all, /* Check of distribute list type. */ if (strncmp (argv[1], "i", 1) == 0) - type = DISTRIBUTE_IN; + type = DISTRIBUTE_V4_IN; else if (strncmp (argv[1], "o", 1) == 0) - type = DISTRIBUTE_OUT; + type = DISTRIBUTE_V4_OUT; else { - vty_out (vty, "distribute list direction must be [in|out]%s", + vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); return CMD_WARNING; } @@ -467,15 +575,39 @@ DEFUN (no_distribute_list_prefix_all, return CMD_SUCCESS; } -ALIAS (no_distribute_list_prefix_all, +DEFUN (no_ipv6_distribute_list_prefix_all, no_ipv6_distribute_list_prefix_all_cmd, - "no distribute-list prefix WORD (in|out)", + "no ipv6 distribute-list prefix WORD (in|out)", NO_STR "Filter networks in routing updates\n" "Filter prefixes in routing updates\n" "Name of an IP prefix-list\n" "Filter incoming routing updates\n" "Filter outgoing routing updates\n") +{ + int ret; + enum distribute_type type; + + /* Check of distribute list type. */ + if (strncmp (argv[1], "i", 1) == 0) + type = DISTRIBUTE_V6_IN; + else if (strncmp (argv[1], "o", 1) == 0) + type = DISTRIBUTE_V6_OUT; + else + { + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + ret = distribute_list_prefix_unset (NULL, type, argv[0]); + if (! ret) + { + vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} DEFUN (distribute_list_prefix, distribute_list_prefix_cmd, "distribute-list prefix WORD (in|out) WORD", @@ -490,12 +622,12 @@ DEFUN (distribute_list_prefix, distribute_list_prefix_cmd, /* Check of distribute list type. */ if (strncmp (argv[1], "i", 1) == 0) - type = DISTRIBUTE_IN; + type = DISTRIBUTE_V4_IN; else if (strncmp (argv[1], "o", 1) == 0) - type = DISTRIBUTE_OUT; + type = DISTRIBUTE_V4_OUT; else { - vty_out (vty, "distribute list direction must be [in|out]%s", + vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); return CMD_WARNING; } @@ -506,14 +638,35 @@ DEFUN (distribute_list_prefix, distribute_list_prefix_cmd, return CMD_SUCCESS; } -ALIAS (distribute_list_prefix, ipv6_distribute_list_prefix_cmd, - "distribute-list prefix WORD (in|out) WORD", +DEFUN (ipv6_distribute_list_prefix, + ipv6_distribute_list_prefix_cmd, + "ipv6 distribute-list prefix WORD (in|out) WORD", "Filter networks in routing updates\n" "Filter prefixes in routing updates\n" "Name of an IP prefix-list\n" "Filter incoming routing updates\n" "Filter outgoing routing updates\n" "Interface name\n") +{ + enum distribute_type type; + + /* Check of distribute list type. */ + if (strncmp (argv[1], "i", 1) == 0) + type = DISTRIBUTE_V6_IN; + else if (strncmp (argv[1], "o", 1) == 0) + type = DISTRIBUTE_V6_OUT; + else + { + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + /* Get interface name corresponding distribute list. */ + distribute_list_prefix_set (argv[2], type, argv[0]); + + return CMD_SUCCESS; +} DEFUN (no_distribute_list_prefix, no_distribute_list_prefix_cmd, "no distribute-list prefix WORD (in|out) WORD", @@ -530,12 +683,12 @@ DEFUN (no_distribute_list_prefix, no_distribute_list_prefix_cmd, /* Check of distribute list type. */ if (strncmp (argv[1], "i", 1) == 0) - type = DISTRIBUTE_IN; + type = DISTRIBUTE_V4_IN; else if (strncmp (argv[1], "o", 1) == 0) - type = DISTRIBUTE_OUT; + type = DISTRIBUTE_V4_OUT; else { - vty_out (vty, "distribute list direction must be [in|out]%s", + vty_out (vty, "distribute list direction must be [in|out]%s", VTY_NEWLINE); return CMD_WARNING; } @@ -549,8 +702,9 @@ DEFUN (no_distribute_list_prefix, no_distribute_list_prefix_cmd, return CMD_SUCCESS; } -ALIAS (no_distribute_list_prefix, no_ipv6_distribute_list_prefix_cmd, - "no distribute-list prefix WORD (in|out) WORD", +DEFUN (no_ipv6_distribute_list_prefix, + no_ipv6_distribute_list_prefix_cmd, + "no ipv6 distribute-list prefix WORD (in|out) WORD", NO_STR "Filter networks in routing updates\n" "Filter prefixes in routing updates\n" @@ -558,6 +712,30 @@ ALIAS (no_distribute_list_prefix, no_ipv6_distribute_list_prefix_cmd, "Filter incoming routing updates\n" "Filter outgoing routing updates\n" "Interface name\n") +{ + int ret; + enum distribute_type type; + + /* Check of distribute list type. */ + if (strncmp (argv[1], "i", 1) == 0) + type = DISTRIBUTE_V6_IN; + else if (strncmp (argv[1], "o", 1) == 0) + type = DISTRIBUTE_V6_OUT; + else + { + vty_out (vty, "distribute list direction must be [in|out]%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + ret = distribute_list_prefix_unset (argv[2], type, argv[0]); + if (! ret) + { + vty_out (vty, "distribute list doesn't exist%s", VTY_NEWLINE); + return CMD_WARNING; + } + return CMD_SUCCESS; +} static int distribute_print (struct vty *vty, char *tab[], int is_prefix, @@ -588,9 +766,13 @@ config_show_distribute (struct vty *vty) if (dist) { has_print = distribute_print(vty, dist->list, 0, - DISTRIBUTE_OUT, has_print); + DISTRIBUTE_V4_OUT, has_print); has_print = distribute_print(vty, dist->prefix, 1, - DISTRIBUTE_OUT, has_print); + DISTRIBUTE_V4_OUT, has_print); + has_print = distribute_print(vty, dist->list, 0, + DISTRIBUTE_V6_OUT, has_print); + has_print = distribute_print(vty, dist->prefix, 1, + DISTRIBUTE_V6_OUT, has_print); } if (has_print) vty_out (vty, "%s", VTY_NEWLINE); @@ -606,9 +788,13 @@ config_show_distribute (struct vty *vty) vty_out (vty, " %s filtered by", dist->ifname); has_print = 0; has_print = distribute_print(vty, dist->list, 0, - DISTRIBUTE_OUT, has_print); + DISTRIBUTE_V4_OUT, has_print); + has_print = distribute_print(vty, dist->prefix, 1, + DISTRIBUTE_V4_OUT, has_print); + has_print = distribute_print(vty, dist->list, 0, + DISTRIBUTE_V6_OUT, has_print); has_print = distribute_print(vty, dist->prefix, 1, - DISTRIBUTE_OUT, has_print); + DISTRIBUTE_V6_OUT, has_print); if (has_print) vty_out (vty, "%s", VTY_NEWLINE); else @@ -624,9 +810,14 @@ config_show_distribute (struct vty *vty) if (dist) { has_print = distribute_print(vty, dist->list, 0, - DISTRIBUTE_IN, has_print); + DISTRIBUTE_V4_IN, has_print); has_print = distribute_print(vty, dist->prefix, 1, - DISTRIBUTE_IN, has_print); } + DISTRIBUTE_V4_IN, has_print); + has_print = distribute_print(vty, dist->list, 0, + DISTRIBUTE_V6_IN, has_print); + has_print = distribute_print(vty, dist->prefix, 1, + DISTRIBUTE_V6_IN, has_print); + } if (has_print) vty_out (vty, "%s", VTY_NEWLINE); else @@ -641,9 +832,13 @@ config_show_distribute (struct vty *vty) vty_out (vty, " %s filtered by", dist->ifname); has_print = 0; has_print = distribute_print(vty, dist->list, 0, - DISTRIBUTE_IN, has_print); + DISTRIBUTE_V4_IN, has_print); + has_print = distribute_print(vty, dist->prefix, 1, + DISTRIBUTE_V4_IN, has_print); + has_print = distribute_print(vty, dist->list, 0, + DISTRIBUTE_V6_IN, has_print); has_print = distribute_print(vty, dist->prefix, 1, - DISTRIBUTE_IN, has_print); + DISTRIBUTE_V6_IN, has_print); if (has_print) vty_out (vty, "%s", VTY_NEWLINE); else @@ -703,8 +898,8 @@ distribute_list_init (int node) { disthash = hash_create (distribute_hash_make, (int (*) (const void *, const void *)) distribute_cmp); - - if(node==RIP_NODE) { + /* install v4 */ + if (node == RIP_NODE || node == BABEL_NODE) { install_element (node, &distribute_list_all_cmd); install_element (node, &no_distribute_list_all_cmd); install_element (node, &distribute_list_cmd); @@ -713,10 +908,10 @@ distribute_list_init (int node) install_element (node, &no_distribute_list_prefix_all_cmd); install_element (node, &distribute_list_prefix_cmd); install_element (node, &no_distribute_list_prefix_cmd); - } else if (node == RIPNG_NODE || node == BABEL_NODE) { - /* WARNING: two identical commands installed do a crash, so be worry with - aliases. For this reason, and because all these commands are aliases, Babel - is not set with RIP. */ + } + + /* install v6 */ + if (node == RIPNG_NODE || node == BABEL_NODE) { install_element (node, &ipv6_distribute_list_all_cmd); install_element (node, &no_ipv6_distribute_list_all_cmd); install_element (node, &ipv6_distribute_list_cmd); diff --git a/lib/distribute.h b/lib/distribute.h index ff06972..bd1e415 100644 --- a/lib/distribute.h +++ b/lib/distribute.h @@ -33,8 +33,10 @@ /* Disctirubte list types. */ enum distribute_type { - DISTRIBUTE_IN, - DISTRIBUTE_OUT, + DISTRIBUTE_V4_IN, + DISTRIBUTE_V6_IN, + DISTRIBUTE_V4_OUT, + DISTRIBUTE_V6_OUT, DISTRIBUTE_MAX }; diff --git a/ripd/ripd.c b/ripd/ripd.c index 5155263..d7982b8 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -167,7 +167,7 @@ rip_filter (int output, struct prefix_ipv4 *p, struct rip_interface *ri) struct distribute *dist; struct access_list *alist; struct prefix_list *plist; - int distribute = output ? DISTRIBUTE_OUT : DISTRIBUTE_IN; + int distribute = output ? DISTRIBUTE_V4_OUT : DISTRIBUTE_V4_IN; int rip_distribute = output ? RIP_FILTER_OUT : RIP_FILTER_IN; /* Input distribute-list filtering. */ @@ -3258,9 +3258,9 @@ rip_distribute_update (struct distribute *dist) 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 @@ -3269,9 +3269,9 @@ rip_distribute_update (struct distribute *dist) 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 @@ -3280,9 +3280,9 @@ rip_distribute_update (struct distribute *dist) 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 @@ -3291,9 +3291,9 @@ rip_distribute_update (struct distribute *dist) 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 diff --git a/ripngd/ripngd.c b/ripngd/ripngd.c index cc86195..45d9649 100644 --- a/ripngd/ripngd.c +++ b/ripngd/ripngd.c @@ -480,7 +480,7 @@ ripng_filter (int output, struct prefix_ipv6 *p, struct ripng_interface *ri) struct distribute *dist; struct access_list *alist; struct prefix_list *plist; - int distribute = output ? DISTRIBUTE_OUT : DISTRIBUTE_IN; + int distribute = output ? DISTRIBUTE_V6_OUT : DISTRIBUTE_V6_IN; int ripng_distribute = output ? RIPNG_FILTER_OUT : RIPNG_FILTER_IN; /* Input distribute-list filtering. */ @@ -2628,9 +2628,9 @@ ripng_distribute_update (struct distribute *dist) ri = ifp->info; - if (dist->list[DISTRIBUTE_IN]) + if (dist->list[DISTRIBUTE_V6_IN]) { - alist = access_list_lookup (AFI_IP6, dist->list[DISTRIBUTE_IN]); + alist = access_list_lookup (AFI_IP6, dist->list[DISTRIBUTE_V6_IN]); if (alist) ri->list[RIPNG_FILTER_IN] = alist; else @@ -2639,9 +2639,9 @@ ripng_distribute_update (struct distribute *dist) else ri->list[RIPNG_FILTER_IN] = NULL; - if (dist->list[DISTRIBUTE_OUT]) + if (dist->list[DISTRIBUTE_V6_OUT]) { - alist = access_list_lookup (AFI_IP6, dist->list[DISTRIBUTE_OUT]); + alist = access_list_lookup (AFI_IP6, dist->list[DISTRIBUTE_V6_OUT]); if (alist) ri->list[RIPNG_FILTER_OUT] = alist; else @@ -2650,9 +2650,9 @@ ripng_distribute_update (struct distribute *dist) else ri->list[RIPNG_FILTER_OUT] = NULL; - if (dist->prefix[DISTRIBUTE_IN]) + if (dist->prefix[DISTRIBUTE_V6_IN]) { - plist = prefix_list_lookup (AFI_IP6, dist->prefix[DISTRIBUTE_IN]); + plist = prefix_list_lookup (AFI_IP6, dist->prefix[DISTRIBUTE_V6_IN]); if (plist) ri->prefix[RIPNG_FILTER_IN] = plist; else @@ -2661,9 +2661,9 @@ ripng_distribute_update (struct distribute *dist) else ri->prefix[RIPNG_FILTER_IN] = NULL; - if (dist->prefix[DISTRIBUTE_OUT]) + if (dist->prefix[DISTRIBUTE_V6_OUT]) { - plist = prefix_list_lookup (AFI_IP6, dist->prefix[DISTRIBUTE_OUT]); + plist = prefix_list_lookup (AFI_IP6, dist->prefix[DISTRIBUTE_V6_OUT]); if (plist) ri->prefix[RIPNG_FILTER_OUT] = plist; else -- 1.7.11.1 _______________________________________________ Quagga-dev mailing list Quagga-dev [at] lists http://lists.quagga.net/mailman/listinfo/quagga-dev
|