tcp: Use defaults when no route options are available
authorGilad Ben-Yossef <gilad@codefidence.com>
Thu, 5 Nov 2009 07:23:10 +0000 (23:23 -0800)
committerDavid S. Miller <davem@davemloft.net>
Thu, 5 Nov 2009 07:24:15 +0000 (23:24 -0800)
Trying to parse the option of a SYN packet that we have
no route entry for should just use global wide defaults
for route entry options.

Signed-off-by: Gilad Ben-Yossef <gilad@codefidence.com>
Tested-by: Valdis.Kletnieks@vt.edu
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/dst.h
net/ipv4/tcp_input.c

index 39c4a59..387cb3c 100644 (file)
@@ -113,7 +113,7 @@ dst_metric(const struct dst_entry *dst, int metric)
 static inline u32
 dst_feature(const struct dst_entry *dst, u32 feature)
 {
-       return dst_metric(dst, RTAX_FEATURES) & feature;
+       return (dst ? dst_metric(dst, RTAX_FEATURES) & feature : 0);
 }
 
 static inline u32 dst_mtu(const struct dst_entry *dst)
index ba0eab6..be0c5bf 100644 (file)
@@ -3704,8 +3704,6 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx,
        struct tcphdr *th = tcp_hdr(skb);
        int length = (th->doff * 4) - sizeof(struct tcphdr);
 
-       BUG_ON(!estab && !dst);
-
        ptr = (unsigned char *)(th + 1);
        opt_rx->saw_tstamp = 0;