From patchwork Tue Nov 3 19:21:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gilad Ben-Yossef X-Patchwork-Id: 37525 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 99220B7BC7 for ; Wed, 4 Nov 2009 06:21:36 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752566AbZKCTV2 (ORCPT ); Tue, 3 Nov 2009 14:21:28 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751614AbZKCTV2 (ORCPT ); Tue, 3 Nov 2009 14:21:28 -0500 Received: from xenbox.codefidence.com ([92.48.73.16]:42244 "EHLO xenbox.codefidence.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751254AbZKCTV2 (ORCPT ); Tue, 3 Nov 2009 14:21:28 -0500 Received: by xenbox.codefidence.com (Postfix, from userid 56) id DC4E4245A7; Tue, 3 Nov 2009 14:21:32 -0500 (EST) Received: from watson.codefidence.com (unknown [95.35.166.111]) by xenbox.codefidence.com (Postfix) with ESMTP id 3AB8224094; Tue, 3 Nov 2009 14:21:27 -0500 (EST) Received: (nullmailer pid 13700 invoked by uid 1000); Tue, 03 Nov 2009 19:21:25 -0000 From: Gilad Ben-Yossef To: Valdis.Kletnieks@vt.edu Cc: netdev@vger.kernel.org, ori@comsleep.com, linux-kernel@vger.kernel.org, Andrew Morton Subject: [PATCH 1/1] Use defaults when no route options are available Date: Tue, 3 Nov 2009 21:21:25 +0200 Message-Id: <1257276085-13681-1-git-send-email-gilad@codefidence.com> X-Mailer: git-send-email 1.5.6.3 In-Reply-To: <4AF07024.80103@gmail.com> References: <4AF07024.80103@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- include/net/dst.h | 2 +- net/ipv4/tcp_input.c | 2 -- 2 files changed, 1 insertions(+), 3 deletions(-) diff --git a/include/net/dst.h b/include/net/dst.h index b562be3..0654c27 100644 --- a/include/net/dst.h +++ b/include/net/dst.h @@ -114,7 +114,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) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 4262da5..57e99e1 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -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;