P1sec / pycrate

A Python library to ease the development of encoders and decoders for various protocols and file formats; contains ASN.1 and CSN.1 compilers.
GNU Lesser General Public License v2.1
381 stars 132 forks source link

VLAN class broken because of typo #165

Closed FreddyD777 closed 2 years ago

FreddyD777 commented 2 years ago

I can't get ethernet packets with VLAN to parse and i think the issue is a misuse of 'get_valauto' instead of 'set_valauto' in the __init__ func.
It makes no sense to call the "get" func where usually "set" functions are used so i assumed it's typo.

Currently the bug is at:
pycrate_ether/Ethernet.py
-> VLAN class (line 109)
--> __init__ function
---> self[3].get_valauto(self._set_type_val) (line 118)

See for example the Ethernet class a few lines above which use 'set_valauto' for an idantical field (ether type).

p1-bmu commented 2 years ago

Good catch ! Commit f62d031ae3486536df67c97d1038337aa55c0321 should solve the issue. Thanks