Skip to content

Commit 5de87df

Browse files
committed
snmp v3 manager - authorative engine detection fix
1 parent 7565d24 commit 5de87df

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "hat-drivers"
3-
version = "0.8.11"
3+
version = "0.8.12"
44
description = "Hat communication drivers"
55
readme = "README.rst"
66
requires-python = ">=3.10"

src_py/hat/drivers/snmp/manager/v3.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -200,18 +200,6 @@ async def _receive_loop(self):
200200
encoder.v3.MsgType.REPORT):
201201
raise Exception('invalid response message type')
202202

203-
req_msg, future = self._req_msg_futures[res_msg.id]
204-
205-
if res_msg.auth != req_msg.auth:
206-
raise Exception('invalid auth flag')
207-
208-
if res_msg.priv != req_msg.priv:
209-
raise Exception('invalid priv flag')
210-
211-
if (res_msg.type == encoder.v3.MsgType.RESPONSE and
212-
res_msg.context != req_msg.context):
213-
raise Exception('invalid context')
214-
215203
if (self._authorative_engine and
216204
self._authorative_engine.id !=
217205
res_msg.authorative_engine.id):
@@ -237,6 +225,18 @@ async def _receive_loop(self):
237225
self._authorative_engine = res_msg.authorative_engine
238226
self._authorative_engine_set_time = time.monotonic()
239227

228+
req_msg, future = self._req_msg_futures[res_msg.id]
229+
230+
if res_msg.auth != req_msg.auth:
231+
raise Exception('invalid auth flag')
232+
233+
if res_msg.priv != req_msg.priv:
234+
raise Exception('invalid priv flag')
235+
236+
if (res_msg.type == encoder.v3.MsgType.RESPONSE and
237+
res_msg.context != req_msg.context):
238+
raise Exception('invalid context')
239+
240240
# TODO check user
241241

242242
res = (

0 commit comments

Comments
 (0)