From patchwork Tue Nov 5 14:28:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florent Fourcot X-Patchwork-Id: 288544 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.180.67]) by ozlabs.org (Postfix) with ESMTP id A7C742C0141 for ; Wed, 6 Nov 2013 01:29:17 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755301Ab3KEO3L (ORCPT ); Tue, 5 Nov 2013 09:29:11 -0500 Received: from fourcot.fr ([217.70.191.14]:40708 "EHLO olfflo.fourcot.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755235Ab3KEO3I (ORCPT ); Tue, 5 Nov 2013 09:29:08 -0500 Received: from reglisse.fourcot.fr (dud31.inf.tu-dresden.de [141.76.46.31]) (Authenticated sender: reglisse) by olfflo.fourcot.fr (Postfix) with ESMTPSA id 8984B2DF19; Tue, 5 Nov 2013 15:29:06 +0100 (CET) Received: by reglisse.fourcot.fr (Postfix, from userid 1000) id 415457558B9; Tue, 5 Nov 2013 15:29:06 +0100 (CET) From: Florent Fourcot To: netdev@vger.kernel.org Cc: Florent Fourcot Subject: [PATCH net-next v3 1/4] ipv6: remove old conditions on flow label sharing Date: Tue, 5 Nov 2013 15:28:55 +0100 Message-Id: <1383661738-6083-1-git-send-email-florent.fourcot@enst-bretagne.fr> X-Mailer: git-send-email 1.8.4.rc3 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The code of flow label in Linux Kernel follows the rules of RFC 1809 (an informational one) for conditions on flow label sharing. There rules are not in the last proposed standard for flow label (RFC 6437), or in the previous one (RFC 3697). Since this code does not follow any current or old standard, we can remove it. With this removal, the ipv6_opt_cmp and pv6_hdr_cmp function are now a dead code and it can be removed too. Changelog of v2: * add justification for the change * remove the condition on IPv6 options * remove ipv6_opt_cmp v3: * remove ipv6_hdr_cmp Acked-by: Hannes Frederic Sowa Signed-off-by: Florent Fourcot --- net/ipv6/ip6_flowlabel.c | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/net/ipv6/ip6_flowlabel.c b/net/ipv6/ip6_flowlabel.c index 46e8843..819578e 100644 --- a/net/ipv6/ip6_flowlabel.c +++ b/net/ipv6/ip6_flowlabel.c @@ -465,34 +465,6 @@ static int mem_check(struct sock *sk) return 0; } -static bool ipv6_hdr_cmp(struct ipv6_opt_hdr *h1, struct ipv6_opt_hdr *h2) -{ - if (h1 == h2) - return false; - if (h1 == NULL || h2 == NULL) - return true; - if (h1->hdrlen != h2->hdrlen) - return true; - return memcmp(h1+1, h2+1, ((h1->hdrlen+1)<<3) - sizeof(*h1)); -} - -static bool ipv6_opt_cmp(struct ipv6_txoptions *o1, struct ipv6_txoptions *o2) -{ - if (o1 == o2) - return false; - if (o1 == NULL || o2 == NULL) - return true; - if (o1->opt_nflen != o2->opt_nflen) - return true; - if (ipv6_hdr_cmp(o1->hopopt, o2->hopopt)) - return true; - if (ipv6_hdr_cmp(o1->dst0opt, o2->dst0opt)) - return true; - if (ipv6_hdr_cmp((struct ipv6_opt_hdr *)o1->srcrt, (struct ipv6_opt_hdr *)o2->srcrt)) - return true; - return false; -} - static inline void fl_link(struct ipv6_pinfo *np, struct ipv6_fl_socklist *sfl, struct ip6_flowlabel *fl) { @@ -603,11 +575,6 @@ recheck: uid_eq(fl1->owner.uid, fl->owner.uid))) goto release; - err = -EINVAL; - if (!ipv6_addr_equal(&fl1->dst, &fl->dst) || - ipv6_opt_cmp(fl1->opt, fl->opt)) - goto release; - err = -ENOMEM; if (sfl1 == NULL) goto release;