Skip to content

Conversation

Eeshu-Yadav
Copy link
Contributor

@Eeshu-Yadav Eeshu-Yadav commented Aug 24, 2025

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Closes #624

Description of Changes

This change implements MAC address sanitization in the called_station_id
field of RadiusAccounting to ensure consistent formatting across different
input formats. MAC addresses are now automatically converted to lowercase
colon-separated format (aa:bb:cc:dd:ee:ff) while preserving non-MAC values
unchanged for RFC compliance.

  • Added sanitize_mac_address function in base/models.py using netaddr.EUI
  • Integrated automatic MAC sanitization in AbstractRadiusAccounting.save()
  • Updated test imports to use sanitize_mac_address from base.models
  • Supports multiple MAC formats: colon, dash, dot, and no separators

@Eeshu-Yadav Eeshu-Yadav force-pushed the issues/624-sanitize-called-station-id-mac-address branch 2 times, most recently from d02b555 to df45e2a Compare August 24, 2025 12:50
@Eeshu-Yadav Eeshu-Yadav force-pushed the issues/624-sanitize-called-station-id-mac-address branch from df45e2a to d50dd75 Compare September 2, 2025 07:33
This change implements MAC address sanitization in the called_station_id
field of RadiusAccounting to ensure consistent formatting across different
input formats. MAC addresses are now automatically converted to lowercase
colon-separated format (aa:bb:cc:dd:ee:ff) while preserving non-MAC values
unchanged for RFC compliance.

Changes:
- Added sanitize_mac_address function in base/models.py using netaddr.EUI
- Integrated automatic MAC sanitization in AbstractRadiusAccounting.save()
- Updated test imports to use sanitize_mac_address from base.models
- Supports multiple MAC formats: colon, dash, dot, and no separators

Fixes openwisp#624
@Eeshu-Yadav Eeshu-Yadav force-pushed the issues/624-sanitize-called-station-id-mac-address branch from d50dd75 to b60a905 Compare September 2, 2025 07:39
This change implements MAC address sanitization in the called_station_id
field of RadiusAccounting to ensure consistent formatting across different
input formats. MAC addresses are now automatically converted to lowercase
colon-separated format (aa:bb:cc:dd:ee:ff) while preserving non-MAC values
unchanged for RFC compliance.

Changes:
- Added sanitize_mac_address function in base/models.py using netaddr.EUI
- Integrated automatic MAC sanitization in AbstractRadiusAccounting.save()
- Updated test imports to use sanitize_mac_address from base.models
- Supports multiple MAC formats: colon, dash, dot, and no separators

Fixes openwisp#624
@Eeshu-Yadav Eeshu-Yadav force-pushed the issues/624-sanitize-called-station-id-mac-address branch from b60a905 to ba92950 Compare September 2, 2025 07:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant