]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
igb: check timestamp validity
authorJesse Brandeburg <jesse.brandeburg@intel.com>
Wed, 3 Mar 2021 20:51:03 +0000 (12:51 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 Mar 2021 12:30:24 +0000 (14:30 +0200)
commit8fdd62c52a17c5744eb19cb3e15dd8f2d23fd7a3
tree23d33bb78505fec291dd0f9bc1d92dd0fe828f5a
parent2aafc277e97fa7be30295ed41d86f6913c0770c3
igb: check timestamp validity

[ Upstream commit f0a03a026857d6c7766eb7d5835edbf5523ca15c ]

Add a couple of checks to make sure timestamping is on and that the
timestamp value from DMA is valid. This avoids any functional issues
that could come from a misinterpreted time stamp.

One of the functions changed doesn't need a return value added because
there was no value in checking from the calling locations.

While here, fix a couple of reverse christmas tree issues next to
the code being changed.

Fixes: f56e7bba22fa ("igb: Pull timestamp from fragment before adding it to skb")
Fixes: 9cbc948b5a20 ("igb: add XDP support")
Signed-off-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
Tested-by: Dave Switzer <david.switzer@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/intel/igb/igb.h
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/igb/igb_ptp.c