Commit ccf6ee9a authored by Stefan Sørensen's avatar Stefan Sørensen Committed by David S. Miller

dp83640: Prune rx timestamp list before reading from it

The list of rx timestamps are currently only pruned of old entries when a
new entry is inserted. If no new entries are added, old timestamps may
survive beyond their lifetime, possible causing them to be attached to
packets with the same sequence number after a rollover.
Signed-off-by: default avatarStefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4b063258
...@@ -1398,6 +1398,7 @@ static bool dp83640_rxtstamp(struct phy_device *phydev, ...@@ -1398,6 +1398,7 @@ static bool dp83640_rxtstamp(struct phy_device *phydev,
return false; return false;
spin_lock_irqsave(&dp83640->rx_lock, flags); spin_lock_irqsave(&dp83640->rx_lock, flags);
prune_rx_ts(dp83640);
list_for_each_safe(this, next, &dp83640->rxts) { list_for_each_safe(this, next, &dp83640->rxts) {
rxts = list_entry(this, struct rxts, list); rxts = list_entry(this, struct rxts, list);
if (match(skb, type, rxts)) { if (match(skb, type, rxts)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment