-
Notifications
You must be signed in to change notification settings - Fork 177
Closed
Description
ISSUE TYPE
Bug Report
VERSION
define( 'APPLICATION_VERSION', '6.2.0' );
define( 'APPLICATION_VERDATE', '2021111400' );
SUMMARY
When using the search feature, to search for IP addresses (e.g. /search?search=5.57.80.72),
the green labels for the IP addresses go to the wrong VLAN interface.
It seems to be using the id of the IP address in the ipv4address table instead
of the VLAN interface id, so:
Where the IP is 5.57.80.72, it goes to /interfaces/vlan/edit/72 (should be 88)
Clicking IP 5.57.82.72 goes to interfaces/vlan/edit/583 (should be 1083)
mysql> select * FROM ipv4address WHERE address = '5.57.80.72';
+----+--------+------------+------------+------------+
| id | vlanid | address | created_at | updated_at |
+----+--------+------------+------------+------------+
| 72 | 1 | 5.57.80.72 | NULL | NULL |
+----+--------+------------+------------+------------+
1 row in set (0.00 sec)
mysql> select * FROM ipv4address WHERE address = '5.57.82.72';
+-----+--------+------------+------------+------------+
| id | vlanid | address | created_at | updated_at |
+-----+--------+------------+------------+------------+
| 583 | 1 | 5.57.82.72 | NULL | NULL |
+-----+--------+------------+------------+------------+
1 row in set (0.00 sec)
mysql> select id,ipv4addressid,ipv6addressid,virtualinterfaceid,vlanid from vlaninterface where ipv4addressid = '72';
+----+---------------+---------------+--------------------+--------+
| id | ipv4addressid | ipv6addressid | virtualinterfaceid | vlanid |
+----+---------------+---------------+--------------------+--------+
| 88 | 72 | 62 | 90 | 1 |
+----+---------------+---------------+--------------------+--------+
1 row in set (0.01 sec)
mysql> select id,ipv4addressid,ipv6addressid,virtualinterfaceid,vlanid from vlaninterface where ipv4addressid = '583';
+------+---------------+---------------+--------------------+--------+
| id | ipv4addressid | ipv6addressid | virtualinterfaceid | vlanid |
+------+---------------+---------------+--------------------+--------+
| 1083 | 583 | 452 | 680 | 1 |
+------+---------------+---------------+--------------------+--------+
1 row in set (0.00 sec)
Seems to be in
resources/views/search/additional/ip.foil.php
<?php if( $vli->ipv4address ): ?>
<li>
<a href="<?= route( 'vlan-interface@edit' , [ 'vli' => $vli->id ] ) ?>">
<span class="badge badge-<?php if( $vli->ipv6enabled ): ?>success<?php else: ?>danger<?php endif; ?>">
<?= $t->ee( $vli->ipv4address->address ) ?>
</span>
</a>
</li>
<?php endif; ?>
<?php if( $vli->ipv6address ): ?>
<li>
<a href="<?= route( 'vlan-interface@edit' , [ 'vli' => $vli->id ] ) ?>">
<span class="badge badge-<?php if( $vli->ipv6enabled ): ?>success<?php else: ?>danger<?php endif; ?>">
<?= $t->ee( $vli->ipv6address->address ) ?>
</span>
</a>
</li>
<?php endif; ?>
I've had a look through the code to see if it was something simple, couldn't figure out how to get the correct vlan interface id.
Also it's using $vli->ipv6enabled for both IPv4 and IPv6 links.
STEPS TO REPRODUCE
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels