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

merged 1 commit into from Sep 20, 2016


None yet

4 participants

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
@laf laf added the Bug label Sep 15, 2016

The inspection completed: No new issues


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

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 |       |              |
|   24019 | 02000000000a |       |              |
|   24019 | 02000000000a |      |              |
|   24019 | 02000000000a |      |              |

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

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.
continuous-integration/travis-ci/pr The Travis CI build passed
@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