mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-04 08:45:07 -05:00
ntp: fix exp1 EF search in process_response()
Don't ignore the magic field when searching for the exp1 extension
field in a received response. If there were two exp1 fields in the
packet, and only one of them had the expected magic value, it should
pick the right one.
Fixes: 2319f72b29 ("ntp: add client support for experimental extension field")
This commit is contained in:
@@ -1721,7 +1721,9 @@ process_response(NCR_Instance inst, NTP_Local_Address *local_addr,
|
|||||||
|
|
||||||
switch (ef_type) {
|
switch (ef_type) {
|
||||||
case NTP_EF_EXP1:
|
case NTP_EF_EXP1:
|
||||||
if (inst->ext_field_flags & NTP_EF_FLAG_EXP1 && ef_body_length == sizeof (*ef_exp1))
|
if (inst->ext_field_flags & NTP_EF_FLAG_EXP1 &&
|
||||||
|
ef_body_length == sizeof (*ef_exp1) &&
|
||||||
|
ntohl(((NTP_ExtFieldExp1 *)ef_body)->magic) == NTP_EF_EXP1_MAGIC)
|
||||||
ef_exp1 = ef_body;
|
ef_exp1 = ef_body;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user