mirror of
https://github.com/bgp/bgpq4.git
synced 2024-05-11 05:55:05 +00:00
By default disallow 23456 as origin
Can be bypassed with '-p'
This commit is contained in:
3
bgpq4.8
3
bgpq4.8
@ -114,7 +114,8 @@ generate config for Nokia SR Linux (Cisco IOS by default)
|
|||||||
.It Fl N
|
.It Fl N
|
||||||
generate config for Nokia SR OS classic CLI (Cisco IOS by default).
|
generate config for Nokia SR OS classic CLI (Cisco IOS by default).
|
||||||
.It Fl p
|
.It Fl p
|
||||||
emit prefixes where the origin ASN is in the private ASN range (disabled by default).
|
emit prefixes where the origin ASN is 23456 or in the private ASN range
|
||||||
|
(disabled by default).
|
||||||
.It Fl r Ar len
|
.It Fl r Ar len
|
||||||
allow more specific routes starting with specified masklen too.
|
allow more specific routes starting with specified masklen too.
|
||||||
.It Fl R Ar len
|
.It Fl R Ar len
|
||||||
|
10
expander.c
10
expander.c
@ -183,7 +183,7 @@ int
|
|||||||
bgpq_expander_add_as(struct bgpq_expander *b, char *as)
|
bgpq_expander_add_as(struct bgpq_expander *b, char *as)
|
||||||
{
|
{
|
||||||
char *eoa;
|
char *eoa;
|
||||||
uint32_t asno = 0;
|
uint32_t asno = 0;
|
||||||
struct asn_entry *asne;
|
struct asn_entry *asne;
|
||||||
|
|
||||||
if (!b || !as)
|
if (!b || !as)
|
||||||
@ -191,14 +191,14 @@ bgpq_expander_add_as(struct bgpq_expander *b, char *as)
|
|||||||
|
|
||||||
asno = strtoul(as + 2, &eoa, 10);
|
asno = strtoul(as + 2, &eoa, 10);
|
||||||
if (eoa && *eoa != 0) {
|
if (eoa && *eoa != 0) {
|
||||||
sx_report(SX_ERROR,"Invalid symbol in AS number: '%c' in %s\n",
|
sx_report(SX_ERROR, "Invalid symbol in AS number: '%c' in %s\n",
|
||||||
*eoa, as);
|
*eoa, as);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!expand_special_asn &&
|
if (!expand_special_asn && (asno == 23456 || asno >= 4200000000ul
|
||||||
(asno >= 4200000000ul || (asno >= 64496 && asno <= 65551))) {
|
|| (asno >= 64496 && asno <= 65551))) {
|
||||||
sx_report(SX_ERROR,"Invalid AS number: %u\n", asno);
|
sx_report(SX_ERROR, "Invalid AS number: %u\n", asno);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
1
main.c
1
main.c
@ -94,6 +94,7 @@ usage(int ecode)
|
|||||||
printf(" -M match : extra match conditions for JunOS route-filters\n");
|
printf(" -M match : extra match conditions for JunOS route-filters\n");
|
||||||
printf(" -l name : use specified name for generated access/prefix/.."
|
printf(" -l name : use specified name for generated access/prefix/.."
|
||||||
" list\n");
|
" list\n");
|
||||||
|
printf(" -p : allow special ASNs like 23456 or in the private range");
|
||||||
printf(" -R len : allow more specific routes up to specified masklen\n");
|
printf(" -R len : allow more specific routes up to specified masklen\n");
|
||||||
printf(" -r len : allow more specific routes from masklen specified\n");
|
printf(" -r len : allow more specific routes from masklen specified\n");
|
||||||
printf(" -s : generate sequence numbers in prefix-lists (IOS only)\n");
|
printf(" -s : generate sequence numbers in prefix-lists (IOS only)\n");
|
||||||
|
Reference in New Issue
Block a user