Free peer delay responses and followup messages when sending a new peer delay request

If messages are not freed, it is possible (with purposely crafted traffic) to trigger
a peer delay calculation which will use message's data from the previous round.

Signed-off-by: Delio Brignoli <dbrignoli@audioscience.com>
master
Delio Brignoli 2013-03-13 15:21:45 +01:00 committed by Richard Cochran
parent 4626487ff3
commit 3cc285c691
1 changed files with 10 additions and 0 deletions

10
port.c
View File

@ -820,6 +820,16 @@ static int port_delay_request(struct port *p)
struct ptp_message *msg;
int cnt, pdulen;
/* Time to send a new request, forget current pdelay resp and fup */
if (p->peer_delay_resp) {
msg_put(p->peer_delay_resp);
p->peer_delay_resp = NULL;
}
if (p->peer_delay_fup) {
msg_put(p->peer_delay_fup);
p->peer_delay_fup = NULL;
}
if (p->delayMechanism == DM_P2P)
return port_pdelay_request(p);