提交 6a2a2d6b 编写于 作者: G Gilad Ben-Yossef 提交者: David S. Miller

tcp: Use defaults when no route options are available

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: NGilad Ben-Yossef <gilad@codefidence.com>
Tested-by: Valdis.Kletnieks@vt.edu
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 05eaade2
...@@ -113,7 +113,7 @@ dst_metric(const struct dst_entry *dst, int metric) ...@@ -113,7 +113,7 @@ dst_metric(const struct dst_entry *dst, int metric)
static inline u32 static inline u32
dst_feature(const struct dst_entry *dst, u32 feature) 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) static inline u32 dst_mtu(const struct dst_entry *dst)
......
...@@ -3704,8 +3704,6 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx, ...@@ -3704,8 +3704,6 @@ void tcp_parse_options(struct sk_buff *skb, struct tcp_options_received *opt_rx,
struct tcphdr *th = tcp_hdr(skb); struct tcphdr *th = tcp_hdr(skb);
int length = (th->doff * 4) - sizeof(struct tcphdr); int length = (th->doff * 4) - sizeof(struct tcphdr);
BUG_ON(!estab && !dst);
ptr = (unsigned char *)(th + 1); ptr = (unsigned char *)(th + 1);
opt_rx->saw_tstamp = 0; opt_rx->saw_tstamp = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册