Skip to content

Commit f0dd0aa

Browse files
committed
[NF] Add option for ipv6 max prefixes rather than joint v4/v6 setting [#937]
1 parent ccd7711 commit f0dd0aa

37 files changed

+211
-83
lines changed

app/Console/Commands/SetupWizard.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ public function handle(): int
218218
'type' => Customer::TYPE_INTERNAL,
219219
'shortname' => $data['ixp-shortname'],
220220
'autsys' => $data['asn'],
221-
'maxprefixes' => 1,
221+
'maxprefixes' => config( 'ixp.default_maxprefixes.v4' ),
222+
'maxprefixesv6' => config( 'ixp.default_maxprefixes.v6' ),
222223
'peeringemail' => $data['ixp-email'],
223224
'peeringpolicy' => Customer::PEERING_POLICY_MANDATORY,
224225
'nocphone' => $data['ixp-phone'],

app/Http/Controllers/Api/V4/IrrdbPrefixController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function byCustomerAndProtocol( Request $r ): JsonResponse
6262

6363
$prefixes = false;
6464

65-
if( $cust->maxprefixes < 2000 ){
65+
if( ( $cust->maxprefixes ?? 0 ) < 2000 ){
6666
$prefixes = IrrdbPrefix::where( 'customer_id', $cust->id )->where( 'protocol', $protocol )->get()->toArray();
6767
}
6868

app/Http/Controllers/Customer/CustomerController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ public function edit( Request $r, Customer $cust ): View
225225
'MD5Support' => $r->old( 'MD5Support', $cust->MD5Support ),
226226
'abbreviatedName' => $r->old( 'abbreviatedName', $cust->abbreviatedName ),
227227
'autsys' => $r->old( 'autsys', (string) $cust->autsys ),
228-
'maxprefixes' => $r->old( 'maxprefixes', (string) $cust->maxprefixes ),
228+
'maxprefixes' => $r->old( 'maxprefixes', (string) $cust->maxprefixes ),
229+
'maxprefixesv6' => $r->old( 'maxprefixesv6', (string) $cust->maxprefixesv6 ),
229230
'peeringpolicy' => $r->old( 'peeringpolicy', $cust->peeringpolicy ),
230231
'peeringemail' => $r->old( 'peeringemail', $cust->peeringemail ),
231232
'peeringmacro' => $r->old( 'peeringmacro', $cust->peeringmacro ),

app/Http/Controllers/Interfaces/VlanInterfaceController.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function duplicateForm( VlanInterface $vli, Vlan $v ): View
9292
}
9393

9494
/**
95-
* Display the form to edit a VLAM interface
95+
* Display the form to edit a VLAN interface
9696
*
9797
* @param Request $r
9898
* @param VirtualInterface $vi The virtual interface to add this VLI to
@@ -102,7 +102,8 @@ public function duplicateForm( VlanInterface $vli, Vlan $v ): View
102102
public function create( Request $r, VirtualInterface $vi ): View
103103
{
104104
Former::populate( [
105-
'maxbgpprefix' => $r->old( 'maxbgpprefix', $vi->customer->maxprefixes ),
105+
'ipv4maxbgpprefix' => $r->old( 'ipv4maxbgpprefix', (string)$vi->customer->maxprefixes ),
106+
'ipv6maxbgpprefix' => $r->old( 'ipv6maxbgpprefix', (string)$vi->customer->maxprefixesv6 ),
106107
] );
107108

108109
return view( 'interfaces/vlan/edit' )->with( [
@@ -160,9 +161,9 @@ public function edit( Request $r, VlanInterface $vli, VirtualInterface $vi = nul
160161
'ipv4address' => $r->old( 'ipv4address', (string)$vli->ipv4addressid ),
161162
'ipv4hostname' => $r->old( 'ipv4hostname', $vli->ipv4hostname ),
162163
'ipv4bgpmd5secret' => $r->old( 'ipv4bgpmd5secret', $vli->ipv4bgpmd5secret ),
164+
'ipv4maxbgpprefix' => $r->old( 'ipv4maxbgpprefix', (string)$vli->ipv4maxbgpprefix ),
163165
'ipv4canping' => $r->old( 'ipv4canping', (string)$vli->ipv4canping ),
164166
'ipv4monitorrcbgp' => $r->old( 'ipv4monitorrcbgp', (string)$vli->ipv4monitorrcbgp ),
165-
'maxbgpprefix' => $r->old( 'maxbgpprefix', (string)$vli->maxbgpprefix ),
166167
'rsclient' => $r->old( 'rsclient', (string)$vli->rsclient ),
167168
'rsmorespecifics' => $r->old( 'rsmorespecifics', (string)$vli->rsmorespecifics ),
168169
'as112client' => $r->old( 'as112client', (string)$vli->as112client ),
@@ -171,6 +172,7 @@ public function edit( Request $r, VlanInterface $vli, VirtualInterface $vi = nul
171172
'ipv6address' => $r->old( 'ipv6address', (string)$vli->ipv6addressid ),
172173
'ipv6hostname' => $r->old( 'ipv6hostname', $vli->ipv6hostname ),
173174
'ipv6bgpmd5secret' => $r->old( 'ipv6bgpmd5secret', $vli->ipv6bgpmd5secret ),
175+
'ipv6maxbgpprefix' => $r->old( 'ipv6maxbgpprefix', (string)$vli->ipv6maxbgpprefix ),
174176
'ipv6canping' => $r->old( 'ipv6canping', (string)$vli->ipv6canping ),
175177
'ipv6monitorrcbgp' => $r->old( 'ipv6monitorrcbgp', (string)$vli->ipv6monitorrcbgp ),
176178
] );

app/Http/Controllers/RsFilterController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function create( Request $r, Customer $cust ): View
166166
] );
167167

168168
$advertisedPrefixes = [];
169-
if( $cust->maxprefixes < 2000 ) {
169+
if( ( $cust->maxprefixes ?? 0 ) < 2000 ) {
170170
$advertisedPrefixes = IrrdbPrefix::where( 'customer_id', $cust->id )
171171
->where( 'protocol', $protocol )->get()->toArray();
172172
}

app/Http/Requests/Customer/Store.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function authorize(): bool
6060
*
6161
* @return (string|string[])[]
6262
*
63-
* @psalm-return array{name: 'required|string|max:255', type: string, shortname: string, corpwww: 'nullable|url|max:255', datejoin: 'required|date', dateleft: 'nullable|date', status: string, md5support: string, abbreviatedName: 'required|string|max:30', autsys?: 'int|min:1', maxprefixes?: 'nullable|int|min:0', peeringemail?: 'email', peeringmacro?: list{'nullable', 'string', 'max:255', 'regex:/^(AS-[A-Z0-9]+(?:-[A-Z0-9]+)*|AS[1-9]\d*(?::AS-[A-Z0-9]+(?:-[A-Z0-9]+)*)?)$/i'}, peeringmacrov6?: list{'nullable', 'string', 'max:255', 'regex:/^(AS-[A-Z0-9]+(?:-[A-Z0-9]+)*|AS[1-9]\d*(?::AS-[A-Z0-9]+(?:-[A-Z0-9]+)*)?)$/i'}, peeringpolicy?: string, irrdb?: 'nullable|integer|exists:irrdbconfig,id', nocphone?: 'nullable|string|max:255', noc24hphone?: 'nullable|string|max:255', nocemail?: 'email|max:255', nochours?: string, nocwww?: 'nullable|url|max:255', reseller?: 'nullable|integer|exists:cust,id'}
63+
* @psalm-return array{name: 'required|string|max:255', type: string, shortname: string, corpwww: 'nullable|url|max:255', datejoin: 'required|date', dateleft: 'nullable|date', status: string, md5support: string, abbreviatedName: 'required|string|max:30', autsys?: 'int|min:1', maxprefixes?: 'nullable|int|min:0', maxprefixesv6?: 'nullable|int|min:0', peeringemail?: 'email', peeringmacro?: list{'nullable', 'string', 'max:255', 'regex:/^(AS-[A-Z0-9]+(?:-[A-Z0-9]+)*|AS[1-9]\d*(?::AS-[A-Z0-9]+(?:-[A-Z0-9]+)*)?)$/i'}, peeringmacrov6?: list{'nullable', 'string', 'max:255', 'regex:/^(AS-[A-Z0-9]+(?:-[A-Z0-9]+)*|AS[1-9]\d*(?::AS-[A-Z0-9]+(?:-[A-Z0-9]+)*)?)$/i'}, peeringpolicy?: string, irrdb?: 'nullable|integer|exists:irrdbconfig,id', nocphone?: 'nullable|string|max:255', noc24hphone?: 'nullable|string|max:255', nocemail?: 'email|max:255', nochours?: string, nocwww?: 'nullable|url|max:255', reseller?: 'nullable|integer|exists:cust,id'}
6464
*/
6565
public function rules(): array
6666
{
@@ -79,6 +79,7 @@ public function rules(): array
7979
$validateOtherDetails = [
8080
'autsys' => 'int|min:1',
8181
'maxprefixes' => 'nullable|int|min:0',
82+
'maxprefixesv6' => 'nullable|int|min:0',
8283
'peeringemail' => 'email',
8384
'peeringmacro' => [ 'nullable', 'string', 'max:255', 'regex:/^(AS-[A-Z0-9]+(?:-[A-Z0-9]+)*|AS[1-9]\d*(?::AS-[A-Z0-9]+(?:-[A-Z0-9]+)*)?)$/i' ],
8485
'peeringmacrov6' => [ 'nullable', 'string', 'max:255', 'regex:/^(AS-[A-Z0-9]+(?:-[A-Z0-9]+)*|AS[1-9]\d*(?::AS-[A-Z0-9]+(?:-[A-Z0-9]+)*)?)$/i' ],

app/Http/Requests/StoreVirtualInterfaceWizard.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function authorize(): bool
6262
*
6363
* @return ((IdnValidate|string)[]|string)[]
6464
*
65-
* @psalm-return array{custid: 'required|integer|exists:cust,id', vlanid: 'required|integer|exists:vlan,id', trunk: 'boolean', switch: 'required|integer|exists:switch,id', switchportid: 'required|integer|exists:switchport,id', status: string, speed: string, duplex: string, maxbgpprefix: 'integer|nullable', mcastenabled: 'boolean', rsclient: 'boolean', irrdbfilter: 'boolean', rsmorespecifics: 'boolean', as112client: 'boolean', ipv4enabled: 'boolean', ipv4address: 'ipv4|nullable'|'ipv4|required', ipv4hostname: list{'string', 'max:255', 'nullable'|'required', IdnValidate}, ipv4bgpmd5secret: 'string|max:255|nullable', ipv4canping: 'boolean', ipv4monitorrcbgp: 'boolean', ipv6enabled: 'boolean', ipv6address: 'ipv6|nullable'|'ipv6|required', ipv6hostname: list{'string', 'max:255', 'nullable'|'required', IdnValidate}, ipv6bgpmd5secret: 'string|max:255|nullable', ipv6canping: 'boolean', ipv6monitorrcbgp: 'boolean'}
65+
* @psalm-return array{custid: 'required|integer|exists:cust,id', vlanid: 'required|integer|exists:vlan,id', trunk: 'boolean', switch: 'required|integer|exists:switch,id', switchportid: 'required|integer|exists:switchport,id', status: string, speed: string, duplex: string, ipv4maxbgpprefix: 'integer|nullable', ipv6maxbgpprefix: 'integer|nullable', mcastenabled: 'boolean', rsclient: 'boolean', irrdbfilter: 'boolean', rsmorespecifics: 'boolean', as112client: 'boolean', ipv4enabled: 'boolean', ipv4address: 'ipv4|nullable'|'ipv4|required', ipv4hostname: list{'string', 'max:255', 'nullable'|'required', IdnValidate}, ipv4bgpmd5secret: 'string|max:255|nullable', ipv4canping: 'boolean', ipv4monitorrcbgp: 'boolean', ipv6enabled: 'boolean', ipv6address: 'ipv6|nullable'|'ipv6|required', ipv6hostname: list{'string', 'max:255', 'nullable'|'required', IdnValidate}, ipv6bgpmd5secret: 'string|max:255|nullable', ipv6canping: 'boolean', ipv6monitorrcbgp: 'boolean'}
6666
*/
6767
public function rules(): array
6868
{
@@ -77,7 +77,6 @@ public function rules(): array
7777
'speed' => 'required|integer|in:' . implode( ',', array_keys( PhysicalInterface::$SPEED ) ),
7878
'duplex' => 'required|string|in:' . implode( ',', array_keys( PhysicalInterface::$DUPLEX ) ),
7979

80-
'maxbgpprefix' => 'integer|nullable',
8180
'mcastenabled' => 'boolean',
8281
'rsclient' => 'boolean',
8382
'irrdbfilter' => 'boolean',
@@ -88,13 +87,15 @@ public function rules(): array
8887
'ipv4address' => 'ipv4|' . ( $this->ipv4enabled ? 'required' : 'nullable' ),
8988
'ipv4hostname' => [ 'string', 'max:255' , ( ( config('ixp_fe.vlaninterfaces.hostname_required' ) && $this->ipv4enabled ) ? 'required' : 'nullable' ), new IdnValidate() ],
9089
'ipv4bgpmd5secret' => 'string|max:255|nullable',
90+
'ipv4maxbgpprefix' => 'integer|nullable',
9191
'ipv4canping' => 'boolean',
9292
'ipv4monitorrcbgp' => 'boolean',
9393

9494
'ipv6enabled' => 'boolean',
9595
'ipv6address' => 'ipv6|' . ( $this->ipv6enabled ? 'required' : 'nullable' ),
9696
'ipv6hostname' => [ 'string', 'max:255' , ( ( config('ixp_fe.vlaninterfaces.hostname_required' ) && $this->ipv6enabled ) ? 'required' : 'nullable' ), new IdnValidate() ],
9797
'ipv6bgpmd5secret' => 'string|max:255|nullable',
98+
'ipv6maxbgpprefix' => 'integer|nullable',
9899
'ipv6canping' => 'boolean',
99100
'ipv6monitorrcbgp' => 'boolean',
100101
];

app/Http/Requests/StoreVlanInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function authorize(): bool
6060
*
6161
* @return ((IdnValidate|string)[]|string)[]
6262
*
63-
* @psalm-return array{vlanid: 'required|integer|exists:vlan,id', virtualinterfaceid: 'required|integer|exists:virtualinterface,id', irrdbfilter: 'boolean', mcastenabled: 'boolean', ipv4enabled: 'boolean', ipv4address: 'ipv4|nullable'|'ipv4|required', ipv4hostname: list{'string', 'max:255', 'nullable'|'required', IdnValidate}, ipv4bgpmd5secret: 'string|max:255|nullable', ipv4canping: 'boolean', ipv4monitorrcbgp: 'boolean', maxbgpprefix: 'integer|nullable', rsclient: 'boolean', rsmorespecifics: 'boolean', as112client: 'boolean', busyhost: 'boolean', ipv6enabled: 'boolean', ipv6address: 'ipv6|nullable'|'ipv6|required', ipv6hostname: list{'string', 'max:255', 'nullable'|'required', IdnValidate}, ipv6bgpmd5secret: 'string|max:255|nullable', ipv6canping: 'boolean', ipv6monitorrcbgp: 'boolean'}
63+
* @psalm-return array{vlanid: 'required|integer|exists:vlan,id', virtualinterfaceid: 'required|integer|exists:virtualinterface,id', irrdbfilter: 'boolean', mcastenabled: 'boolean', ipv4enabled: 'boolean', ipv4address: 'ipv4|nullable'|'ipv4|required', ipv4hostname: list{'string', 'max:255', 'nullable'|'required', IdnValidate}, ipv4bgpmd5secret: 'string|max:255|nullable', ipv4canping: 'boolean', ipv4monitorrcbgp: 'boolean', ipv4maxbgpprefix: 'integer|nullable', ipv6maxbgpprefix: 'integer|nullable', rsclient: 'boolean', rsmorespecifics: 'boolean', as112client: 'boolean', busyhost: 'boolean', ipv6enabled: 'boolean', ipv6address: 'ipv6|nullable'|'ipv6|required', ipv6hostname: list{'string', 'max:255', 'nullable'|'required', IdnValidate}, ipv6bgpmd5secret: 'string|max:255|nullable', ipv6canping: 'boolean', ipv6monitorrcbgp: 'boolean'}
6464
*/
6565
public function rules(): array
6666
{
@@ -73,9 +73,9 @@ public function rules(): array
7373
'ipv4address' => 'ipv4' . ( $this->ipv4enabled ? '|required' : '|nullable' ),
7474
'ipv4hostname' => [ 'string', 'max:255' , ( ( config('ixp_fe.vlaninterfaces.hostname_required' ) && $this->ipv4enabled ) ? 'required' : 'nullable' ), new IdnValidate() ],
7575
'ipv4bgpmd5secret' => 'string|max:255|nullable',
76+
'ipv4maxbgpprefix' => 'integer|nullable',
7677
'ipv4canping' => 'boolean',
7778
'ipv4monitorrcbgp' => 'boolean',
78-
'maxbgpprefix' => 'integer|nullable',
7979
'rsclient' => 'boolean',
8080
'rsmorespecifics' => 'boolean',
8181
'as112client' => 'boolean',
@@ -84,6 +84,7 @@ public function rules(): array
8484
'ipv6address' => 'ipv6' . ( $this->ipv6enabled ? '|required' : '|nullable' ),
8585
'ipv6hostname' => [ 'string', 'max:255' , ( ( config('ixp_fe.vlaninterfaces.hostname_required' ) && $this->ipv6enabled ) ? 'required' : 'nullable' ), new IdnValidate() ],
8686
'ipv6bgpmd5secret' => 'string|max:255|nullable',
87+
'ipv6maxbgpprefix' => 'integer|nullable',
8788
'ipv6canping' => 'boolean',
8889
'ipv6monitorrcbgp' => 'boolean',
8990
];

app/Models/Aggregators/CustomerAggregator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@
184184
* @method static Builder|CustomerAggregator whereCreated($value)
185185
* @method static Builder|CustomerAggregator whereLastupdated($value)
186186
* @property-read \IXP\Models\IrrdbUpdateLog|null $irrdbUpdateLog
187+
* @property int|null $maxprefixesv6
188+
* @method static Builder<static>|CustomerAggregator whereMaxprefixesv6($value)
187189
* @mixin \Eloquent
188190
*/
189191
class CustomerAggregator extends Customer
@@ -223,7 +225,7 @@ public static function getByVlanAndProtocol( ?int $vlanid = null, ?int $protocol
223225
}
224226

225227
/**
226-
* Build an array of data for the peering matrice
228+
* Build an array of data for the peering matrix
227229
*
228230
* Sample return:
229231
*

app/Models/Aggregators/VlanInterfaceAggregator.php

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
* @property string|null $bgpmd5secret
4848
* @property string|null $ipv4bgpmd5secret
4949
* @property string|null $ipv6bgpmd5secret
50-
* @property int|null $maxbgpprefix
5150
* @property int|null $rsclient
5251
* @property int|null $ipv4canping
5352
* @property int|null $ipv6canping
@@ -86,14 +85,17 @@
8685
* @method static Builder|VlanInterfaceAggregator whereIpv6hostname($value)
8786
* @method static Builder|VlanInterfaceAggregator whereIpv6monitorrcbgp($value)
8887
* @method static Builder|VlanInterfaceAggregator whereIrrdbfilter($value)
89-
* @method static Builder|VlanInterfaceAggregator whereMaxbgpprefix($value)
9088
* @method static Builder|VlanInterfaceAggregator whereMcastenabled($value)
9189
* @method static Builder|VlanInterfaceAggregator whereNotes($value)
9290
* @method static Builder|VlanInterfaceAggregator whereRsclient($value)
9391
* @method static Builder|VlanInterfaceAggregator whereRsmorespecifics($value)
9492
* @method static Builder|VlanInterfaceAggregator whereUpdatedAt($value)
9593
* @method static Builder|VlanInterfaceAggregator whereVirtualinterfaceid($value)
9694
* @method static Builder|VlanInterfaceAggregator whereVlanid($value)
95+
* @property int|null $ipv4maxbgpprefix
96+
* @property int|null $ipv6maxbgpprefix
97+
* @method static Builder<static>|VlanInterfaceAggregator whereIpv4maxbgpprefix($value)
98+
* @method static Builder<static>|VlanInterfaceAggregator whereIpv6maxbgpprefix($value)
9799
* @mixin \Eloquent
98100
*/
99101
class VlanInterfaceAggregator extends VlanInterface
@@ -187,7 +189,8 @@ public static function forProto( Vlan $vlan, int $proto, ?int $pistatus = Physic
187189
'cust.id AS cid', 'cust.name AS cname',
188190
'cust.abbreviatedName AS abrevcname',
189191
'cust.shortname AS cshortname',
190-
'cust.autsys AS autsys', 'cust.maxprefixes AS gmaxprefixes',
192+
'cust.autsys AS autsys',
193+
( $proto === 4 ? 'cust.maxprefixes' : 'cust.maxprefixesv6' ) . ' AS gmaxprefixes',
191194
'cust.peeringmacro AS peeringmacro', 'cust.peeringmacrov6 AS peeringmacrov6',
192195

193196
'v.id AS vid', 'v.number AS vtag', 'v.name AS vname', 'vi.id AS viid',
@@ -198,7 +201,7 @@ public static function forProto( Vlan $vlan, int $proto, ?int $pistatus = Physic
198201
"vli.ipv{$proto}hostname AS hostname" ,
199202
"vli.ipv{$proto}monitorrcbgp AS monitorrcbgp" ,
200203
"vli.ipv{$proto}bgpmd5secret AS bgpmd5secret" ,
201-
'vli.maxbgpprefix AS maxbgpprefix' ,
204+
"vli.ipv{$proto}maxbgpprefix AS maxbgpprefix" ,
202205
'vli.as112client AS as112client' ,
203206
'vli.rsclient AS rsclient' ,
204207
'vli.busyhost AS busyhost' ,
@@ -239,8 +242,8 @@ public static function forProto( Vlan $vlan, int $proto, ?int $pistatus = Physic
239242
}
240243

241244
$q->groupByRaw( "vli.id, cust.id, cust.name, cust.abbreviatedName, cust.shortname, cust.autsys,
242-
cust.maxprefixes, cust.peeringmacro, cust.peeringmacrov6,
243-
vli.ipv{$proto}enabled, addr.address, vli.ipv{$proto}bgpmd5secret, vli.maxbgpprefix,
245+
cust.maxprefixes" . ( $proto === 4 ? '' : 'v6' ) . ", cust.peeringmacro, cust.peeringmacrov6,
246+
vli.ipv{$proto}enabled, addr.address, vli.ipv{$proto}bgpmd5secret, vli.ipv{$proto}maxbgpprefix,
244247
vli.ipv{$proto}hostname, vli.ipv{$proto}monitorrcbgp, vli.busyhost,
245248
vli.as112client, vli.rsclient, vli.irrdbfilter, vli.ipv{$proto}canping,
246249
s.id, s.name,
@@ -382,14 +385,14 @@ public static function sanitiseVlanInterfaces( Vlan $vlan, int $protocol = 4, in
382385

383386
$int['fvliid'] = sprintf( '%04d', $int['vliid'] );
384387

385-
if( $int['maxbgpprefix'] && $int['maxbgpprefix'] > $int['gmaxprefixes'] ) {
388+
if( $int['maxbgpprefix'] && $int['maxbgpprefix'] > 0 ) {
386389
$int['maxprefixes'] = $int['maxbgpprefix'];
387390
} else {
388391
$int['maxprefixes'] = $int['gmaxprefixes'];
389392
}
390393

391-
if( !$int['maxprefixes'] ) {
392-
$int['maxprefixes'] = 250;
394+
if( !( is_numeric( $int['maxprefixes'] ) && $int['maxprefixes'] > 0 ) ) {
395+
$int['maxprefixes'] = ( $protocol === 4 ? config( 'ixp.default_maxprefixes.v4' ) : config( 'ixp.default_maxprefixes.v6' ) );
393396
}
394397

395398
unset( $int['gmaxprefixes'] );

0 commit comments

Comments
 (0)