Hello,
Here is a patch to remove "u_int16_t neighas", an unused arguments from
community_ext_* functions.
Index: parse.y
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/parse.y,v
retrieving revision 1.298
diff -u -p -r1.298 parse.y
--- parse.y 22 Feb 2017 13:55:14 -0000 1.298
+++ parse.y 22 May 2017 18:52:27 -0000
@@ -848,7 +848,7 @@ rdomainopts : RD STRING {
* RD is almost encode like an ext-community,
* but only almost so convert here.
*/
- if (community_ext_conv(&ext, 0, &rd)) {
+ if (community_ext_conv(&ext, &rd)) {
yyerror("bad encoding of rd");
YYERROR;
}
Index: rde.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.c,v
retrieving revision 1.361
diff -u -p -r1.361 rde.c
--- rde.c 25 Jan 2017 03:21:55 -0000 1.361
+++ rde.c 22 May 2017 18:52:27 -0000
@@ -2455,7 +2455,7 @@ rde_rdomain_import(struct rde_aspath *as
struct filter_set *s;
TAILQ_FOREACH(s, &rd->import, entry) {
- if (community_ext_match(asp, &s->action.ext_community, 0))
+ if (community_ext_match(asp, &s->action.ext_community))
return (1);
}
return (0);
Index: rde.h
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde.h,v
retrieving revision 1.160
diff -u -p -r1.160 rde.h
--- rde.h 25 Jan 2017 03:21:55 -0000 1.160
+++ rde.h 22 May 2017 18:52:27 -0000
@@ -379,12 +379,12 @@ int community_large_set(struct rde_asp
void community_large_delete(struct rde_aspath *, int64_t,
int64_t, int64_t);
int community_ext_match(struct rde_aspath *,
- struct filter_extcommunity *, u_int16_t);
+ struct filter_extcommunity *);
int community_ext_set(struct rde_aspath *,
- struct filter_extcommunity *, u_int16_t);
+ struct filter_extcommunity *);
void community_ext_delete(struct rde_aspath *,
- struct filter_extcommunity *, u_int16_t);
-int community_ext_conv(struct filter_extcommunity *, u_int16_t,
+ struct filter_extcommunity *);
+int community_ext_conv(struct filter_extcommunity *,
u_int64_t *);
/* rde_decide.c */
Index: rde_attr.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde_attr.c,v
retrieving revision 1.97
diff -u -p -r1.97 rde_attr.c
--- rde_attr.c 24 Jan 2017 04:22:42 -0000 1.97
+++ rde_attr.c 22 May 2017 18:52:27 -0000
@@ -974,7 +974,7 @@ aspath_lenmatch(struct aspath *a, enum a
* Functions handling communities and extended communities.
*/
-int community_ext_matchone(struct filter_extcommunity *, u_int16_t, u_int64_t);
+int community_ext_matchone(struct filter_extcommunity *, u_int64_t);
int
community_match(struct rde_aspath *asp, int as, int type)
@@ -1115,8 +1115,7 @@ community_delete(struct rde_aspath *asp,
}
int
-community_ext_match(struct rde_aspath *asp, struct filter_extcommunity *c,
- u_int16_t neighas)
+community_ext_match(struct rde_aspath *asp, struct filter_extcommunity *c)
{
struct attr *attr;
u_int8_t *p;
@@ -1131,7 +1130,7 @@ community_ext_match(struct rde_aspath *a
p = attr->data;
for (len = attr->len / sizeof(ec); len > 0; len--) {
memcpy(&ec, p, sizeof(ec));
- if (community_ext_matchone(c, neighas, ec))
+ if (community_ext_matchone(c, ec))
return (1);
p += sizeof(ec);
}
@@ -1140,8 +1139,7 @@ community_ext_match(struct rde_aspath *a
}
int
-community_ext_set(struct rde_aspath *asp, struct filter_extcommunity *c,
- u_int16_t neighas)
+community_ext_set(struct rde_aspath *asp, struct filter_extcommunity *c)
{
struct attr *attr;
u_int8_t *p = NULL;
@@ -1149,7 +1147,7 @@ community_ext_set(struct rde_aspath *asp
unsigned int i, ncommunities = 0;
u_int8_t f = ATTR_OPTIONAL|ATTR_TRANSITIVE;
- if (community_ext_conv(c, neighas, &community))
+ if (community_ext_conv(c, &community))
return (0);
attr = attr_optget(asp, ATTR_EXT_COMMUNITIES);
@@ -1188,8 +1186,7 @@ community_ext_set(struct rde_aspath *asp
}
void
-community_ext_delete(struct rde_aspath *asp, struct filter_extcommunity *c,
- u_int16_t neighas)
+community_ext_delete(struct rde_aspath *asp, struct filter_extcommunity *c)
{
struct attr *attr;
u_int8_t *p, *n;
@@ -1197,7 +1194,7 @@ community_ext_delete(struct rde_aspath *
u_int16_t l, len = 0;
u_int8_t f;
- if (community_ext_conv(c, neighas, &community))
+ if (community_ext_conv(c, &community))
return;
attr = attr_optget(asp, ATTR_EXT_COMMUNITIES);
@@ -1239,8 +1236,7 @@ community_ext_delete(struct rde_aspath *
}
int
-community_ext_conv(struct filter_extcommunity *c, u_int16_t neighas,
- u_int64_t *community)
+community_ext_conv(struct filter_extcommunity *c, u_int64_t *community)
{
u_int64_t com;
u_int32_t ip;
@@ -1278,8 +1274,7 @@ community_ext_conv(struct filter_extcomm
}
int
-community_ext_matchone(struct filter_extcommunity *c, u_int16_t neighas,
- u_int64_t community)
+community_ext_matchone(struct filter_extcommunity *c, u_int64_t community)
{
u_int64_t com, mask;
u_int32_t ip;
Index: rde_filter.c
===================================================================
RCS file: /cvs/src/usr.sbin/bgpd/rde_filter.c,v
retrieving revision 1.80
diff -u -p -r1.80 rde_filter.c
--- rde_filter.c 24 Jan 2017 04:22:42 -0000 1.80
+++ rde_filter.c 22 May 2017 18:52:27 -0000
@@ -287,12 +287,10 @@ rde_apply_set(struct rde_aspath *asp, st
asp->origin = set->action.origin;
break;
case ACTION_SET_EXT_COMMUNITY:
- community_ext_set(asp, &set->action.ext_community,
- peer->conf.remote_as);
+ community_ext_set(asp, &set->action.ext_community);
break;
case ACTION_DEL_EXT_COMMUNITY:
- community_ext_delete(asp, &set->action.ext_community,
- peer->conf.remote_as);
+ community_ext_delete(asp, &set->action.ext_community);
break;
}
}
@@ -350,8 +348,7 @@ rde_filter_match(struct filter_rule *f,
}
if (asp != NULL &&
(f->match.ext_community.flags & EXT_COMMUNITY_FLAG_VALID))
- if (community_ext_match(asp, &f->match.ext_community,
- peer->conf.remote_as) == 0)
+ if (community_ext_match(asp, &f->match.ext_community) == 0)
return (0);
if (asp != NULL && f->match.large_community.as !=
COMMUNITY_UNSET) {