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
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 */
99101class 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