fix: This removes stale entries in the mac_ipv4 table #4444

Merged
merged 1 commit into from Sep 20, 2016

Projects

None yet

4 participants

@laf
Member
laf commented Sep 15, 2016

Please note

Please read this information carefully. You can run ./scripts/pre-commit.php to check your code before submitting.

The issue before was that an entry in mac_ipv4 is only unique with port_id, mac_address and ipv4_address. Both port_id and mac_address can be in the table multiple times but Ip should only be in it once.

Before this change, arp entries that no longer exist on a device would remain in the mac_ipv4 table.

@laf laf fix: This removes stale entries in the mac_ipv4 table
6eb858d
@laf laf added the Bug label Sep 15, 2016
@scrutinizer-notifier

The inspection completed: No new issues

@murrant

Looks fine to me but I couldn't follow the code and I'm not sure how to test.

@laf
Member
laf commented Sep 16, 2016

So before hand $mac_table[$port_id][$clean_mac] wasn't unique as it was the port id and mac address.

So here's an example:

|   24019 | 02000000000a | 128.0.0.1       |              |
|   24019 | 02000000000a | 128.0.0.4       |              |
|   24019 | 02000000000a | 128.0.0.16      |              |
|   24019 | 02000000000a | 128.0.0.32      |              |

The only difference here is the IP. Before it would have classed all four entries as the same because IP wasn't included.

@murrant
Contributor
murrant commented Sep 20, 2016

I get it, thanks.

@murrant murrant merged commit b43c7f2 into librenms:master Sep 20, 2016

2 checks passed

Auto-Deploy Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@laf laf deleted the laf:arp-stale-entries branch Sep 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment