]> git.baikalelectronics.ru Git - kernel.git/commit
net/ipv4: Timestamp option cannot overflow with prespecified addresses
authorDavid Ward <david.ward@ll.mit.edu>
Tue, 5 Mar 2013 17:06:32 +0000 (17:06 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 6 Mar 2013 07:47:06 +0000 (02:47 -0500)
commit0ac90cf9b412da96b8c979d2b216cdff4365009f
tree8bf9cb65b82803d3d799d95d6a125237af8906fa
parent49cbc5477e2ab0cd2d69bf51350f79a73d93281d
net/ipv4: Timestamp option cannot overflow with prespecified addresses

When a router forwards a packet that contains the IPv4 timestamp option,
if there is no space left in the option for the router to add its own
timestamp, then the router increments the Overflow value in the option.

However, if the addresses of the routers are prespecified in the option,
then the overflow condition cannot happen: the option is structured so
that each prespecified router has a place to write its timestamp. Other
routers do not add a timestamp, so there will never be a lack of space.

This fix ensures that the Overflow value in the IPv4 timestamp option is
not incremented when the addresses of the routers are prespecified, even
if the Pointer value is greater than the Length value.

Signed-off-by: David Ward <david.ward@ll.mit.edu>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_options.c