summaryrefslogtreecommitdiffstats
path: root/net/ipv4/ip_options.c
diff options
context:
space:
mode:
authorDavid Ward <david.ward@ll.mit.edu>2013-03-05 18:06:32 +0100
committerDavid S. Miller <davem@davemloft.net>2013-03-06 08:47:06 +0100
commitfa2b04f4502d74659e4e4b1294c6d88e08ece032 (patch)
tree8bf9cb65b82803d3d799d95d6a125237af8906fa /net/ipv4/ip_options.c
parentnet: reduce net_rx_action() latency to 2 HZ (diff)
downloadlinux-fa2b04f4502d74659e4e4b1294c6d88e08ece032.tar.xz
linux-fa2b04f4502d74659e4e4b1294c6d88e08ece032.zip
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>
Diffstat (limited to '')
-rw-r--r--net/ipv4/ip_options.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index f6289bf6f332..310a3647c83d 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -423,7 +423,7 @@ int ip_options_compile(struct net *net,
put_unaligned_be32(midtime, timeptr);
opt->is_changed = 1;
}
- } else {
+ } else if ((optptr[3]&0xF) != IPOPT_TS_PRESPEC) {
unsigned int overflow = optptr[3]>>4;
if (overflow == 15) {
pp_ptr = optptr + 3;