dp83640: Prune rx timestamp list before reading from it
authorStefan Sørensen <stefan.sorensen@spectralink.com>
Tue, 3 Nov 2015 08:34:06 +0000 (09:34 +0100)
committerDavid S. Miller <davem@davemloft.net>
Tue, 3 Nov 2015 16:08:21 +0000 (11:08 -0500)
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: Stefan Sørensen <stefan.sorensen@spectralink.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/dp83640.c

index 69a2f56e4d68f09c35053fa3532ce9376d80c4f7..39ac633e3ef5f88fa33590f6d273e6fcb5a34c32 100644 (file)
@@ -1398,6 +1398,7 @@ static bool dp83640_rxtstamp(struct phy_device *phydev,
                return false;
 
        spin_lock_irqsave(&dp83640->rx_lock, flags);
+       prune_rx_ts(dp83640);
        list_for_each_safe(this, next, &dp83640->rxts) {
                rxts = list_entry(this, struct rxts, list);
                if (match(skb, type, rxts)) {