Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pfacct stores 00:00:00:00:00:00 MAC in DB when Calling-Station-ID is XXXX-XXXX-XXXX #6109

Closed
nqb opened this issue Jan 27, 2021 · 0 comments
Closed

Comments

@nqb
Copy link
Contributor

nqb commented Jan 27, 2021

Describe the bug
If pfacct receive an Accounting Request with a Calling-Station-ID that uses following convention: XXXX-XXXX-XXXX, an entry is created in bandwidth_accounting table with mac field equals to 00:00:00:00:00:00

To Reproduce
Steps to reproduce the behavior:

  1. Forge an accounting request with specific Calling-Station-ID:
cat > /opt/acct << EOF
NAS-Port-Type = 15
Acct-Input-Octets = 0
Acct-Session-Id = 1111111 
NAS-IP-Address = 192.168.0.1
Called-Station-Id = "F4-E5-F2-FE-6B-61"
Calling-Station-Id = "ecf4-bb37-ddaa"
User-Name = "username@realm.com"
Acct-Authentic = 2
Acct-Status-Type = 3
Acct-Output-Packets = 0
Acct-Output-Octets = 0
Event-Timestamp = "Feb 07 2020 10:30:00 CET"
Acct-Input-Gigawords = 0
Acct-Input-Packets = 0
NAS-Port = 1
Acct-Delay-Time = 0
EOF

cat /opt/acct | radclient -x 172.17.17.10:1813 acct `cat /usr/local/pf/conf/local_secret`
  1. mysql pf -e "select * from bandwidth_accounting;

=> Results:

+-----------------+----------------------+---------------------+-------------+----------+-----------+-------------------+-----------+---------------------+-------------+
| node_id         | unique_session_id    | time_bucket         | source_type | in_bytes | out_bytes | mac               | tenant_id | last_updated        | total_bytes |
+-----------------+----------------------+---------------------+-------------+----------+-----------+-------------------+-----------+---------------------+-------------+
| 281474976710656 | 14713129202345799727 | 2020-02-01 00:00:00 | radius      |        0 |         0 | 00:00:00:00:00:00 |         1 | 2021-01-27 13:19:30 |           0 |
+-----------------+----------------------+---------------------+-------------+----------+-----------+-------------------+-----------+---------------------+-------------+

Expected behavior
All format of MAC address should be supported.

Additional context
PacketFence is able to create an entry in cache because pfcmd cache accounting dump MAC returned accounting data.

@nqb nqb added this to the +1 (patch release) milestone Jan 27, 2021
@nqb nqb changed the title pfacct store 00:00:00:00:00:00 MAC in DB when Calling-Station-ID is XXXX-XXXX-XXXX pfacct stores 00:00:00:00:00:00 MAC in DB when Calling-Station-ID is XXXX-XXXX-XXXX Jan 27, 2021
jrouzierinverse added a commit that referenced this issue Jan 27, 2021
jrouzierinverse added a commit that referenced this issue Jan 27, 2021
jrouzierinverse added a commit that referenced this issue Jan 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants