Project

General

Profile

« Previous | Next » 

Revision 30df6b72

Added by Phil Davis about 9 years ago

Fix #6585 Do not use [] syntax for lookups

IPv6 address plus port is displayed with the format [1:2::3]:80 - the address is in square brackets followed by colon and the port number. This is necessary to disambiguate the port from the address, a good thing. But it messes up the use of the IPv6 address for reverse lookup.
Keep the "raw" format of the IPv6 address pass that to the reverse lookup code, and use it for generating the htmlclass names that enable the answer to be slotted in for display.

View differences:

src/usr/local/www/status_logs_filter.php
248 248

  
249 249
		$int = strtolower($filterent['interface']);
250 250
		$proto = strtolower($filterent['proto']);
251
		$rawsrcip = $filterent['srcip'];
252
		$rawdstip = $filterent['dstip'];
251 253

  
252 254
		if ($filterent['version'] == '6') {
253 255
			$ipproto = "inet6";
......
258 260
		}
259 261

  
260 262
		$srcstr = $filterent['srcip'] . get_port_with_service($filterent['srcport'], $proto);
261
		$src_htmlclass = str_replace(array('.', ':'), '-', $filterent['srcip']);
263
		$src_htmlclass = str_replace(array('.', ':'), '-', $rawsrcip);
262 264
		$dststr = $filterent['dstip'] . get_port_with_service($filterent['dstport'], $proto);
263
		$dst_htmlclass = str_replace(array('.', ':'), '-', $filterent['dstip']);
265
		$dst_htmlclass = str_replace(array('.', ':'), '-', $rawdstip);
264 266
?>
265 267
					<td class="text-nowrap">
266
						<i class="fa fa-info icon-pointer icon-primary" onclick="javascript:resolve_with_ajax('<?="{$filterent['srcip']}"; ?>');" title="<?=gettext("Click to resolve")?>">
268
						<i class="fa fa-info icon-pointer icon-primary" onclick="javascript:resolve_with_ajax('<?="{$rawsrcip}"; ?>');" title="<?=gettext("Click to resolve")?>">
267 269
						</i>
268 270

  
269 271
						<a class="fa fa-minus-square-o icon-pointer icon-primary" href="easyrule.php?<?="action=block&amp;int={$int}&amp;src={$filterent['srcip']}&amp;ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Add to Block List")?>" onclick="return confirm('<?=gettext("Confirmation required to add this BLOCK rule.")?>')">
......
272 274
						<?=$srcstr . '<span class="RESOLVE-' . $src_htmlclass . '"></span>'?>
273 275
					</td>
274 276
					<td class="text-nowrap">
275
						<i class="fa fa-info icon-pointer icon-primary; ICON-<?= $dst_htmlclass; ?>" onclick="javascript:resolve_with_ajax('<?="{$filterent['dstip']}"; ?>');" title="<?=gettext("Click to resolve")?>">
277
						<i class="fa fa-info icon-pointer icon-primary; ICON-<?= $dst_htmlclass; ?>" onclick="javascript:resolve_with_ajax('<?="{$rawdstip}"; ?>');" title="<?=gettext("Click to resolve")?>">
276 278
						</i>
277 279

  
278 280
						<a class="fa fa-plus-square-o icon-pointer icon-primary" href="easyrule.php?<?="action=pass&amp;int={$int}&amp;proto={$proto}&amp;src={$filterent['srcip']}&amp;dst={$filterent['dstip']}&amp;dstport={$filterent['dstport']}&amp;ipproto={$ipproto}"; ?>" title="<?=gettext("Easy Rule: Pass this traffic")?>" onclick="return confirm('<?=gettext("Confirmation required to add this PASS rule.")?>')">

Also available in: Unified diff