Skip to content

[bug] Mac address of called-station-id needs to be sanitized #624

@nemesifier

Description

@nemesifier

The MAC address in the called-station-id field of radius accounting needs to be sanitized because it can come in different formats, eg:

  • 00:1A:2B:3C:4D:5E
  • 00-1A-2B-3C-4D-5E
  • 001A.2B3C.4D5E

Right now, using different formats for the same mac address displays a different mac address in the radius accounting data and it impacts the statistics generated by the monitoring integration.

We are already using netaddr.EUI in the codebase, I believe it would be better if we make a function based on it which can sanitize the mac address and return it in the semicolon format.

We could sanitize it at model level (in RadiusAccounting), hopefully that would work for most use cases and would also propagate to the monitoring integration.

When doing sanitization at model level, I think we shouldn't fail if the called-station-id is not recognized as a mac address, because the RADIUS RFC does not define called-station-id solely as a mac address, even though it's the most common use case in OpenWISP.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Backlog

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions