Track MAC addresses of agents

Only do the work if we're working with non-none.

```python
if mac_addresses is not None:
```