From patchwork Fri Jun 30 03:52:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xin Long X-Patchwork-Id: 782656 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 3wzN1t08N5z9sNV for ; Fri, 30 Jun 2017 13:54:10 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="b1tQAyP0"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752288AbdF3DyI (ORCPT ); Thu, 29 Jun 2017 23:54:08 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33498 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751808AbdF3DyH (ORCPT ); Thu, 29 Jun 2017 23:54:07 -0400 Received: by mail-pf0-f196.google.com with SMTP id e199so15443877pfh.0; Thu, 29 Jun 2017 20:54:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=fHyV8fKkWyvrsYeOT+hOzg56AM1dW5visE4Y3p2TxkY=; b=b1tQAyP0Md8aYPgFI38zXf98pG9Qbs6D4CMfcSk9eJ1L1T4YwXhk9Ceq0Kx2eEMSqt PGCKajPq4V4Q/wKkvo8q7XwvdnjFNAxJgkrlIyH+afBAXjz2OR5RMZDucR38rTSY8Oxf w0/9etrlmU6cXPuav25SA3MleDJKxgECCQZYHcxaL4pUZgV7C8uFLX/IVsX8IJUIaJ+F Ja5l/LgEDFKGWNnz1wBXo22jmvvsAJ7Ys4REXslWYrBc/KytZkc/UG0+fULJVOolZ8jR NXi4UtSSCF02NfSE9NZKEg3QJFZPB7T6Ss+Qe4M3nXeBpATsv60W4Cznr/AlXrkTxU+X nGVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=fHyV8fKkWyvrsYeOT+hOzg56AM1dW5visE4Y3p2TxkY=; b=SVr0E0nDdWDSD9okE8DdpUKGpt6p/zsHn8QJZyyF0IvJmWQ8NhNgFWJ06lDGm0SgLr lPeJ9RoyAK4w0WHr/EG8WS0YXnI0yLHy9WoRI5tUoXjAqwtrC9XWgSyVtlNv/tvSg4Gh iXh+dYHBSKPcMZ0pzXj9kEZj1Wn9G6Rf7Y5+gBogris1hLSkZQ5ngpLh/NSLr1eYPp1A MXPbX/3sMb7NSU8zHWMIWaLxHW4LG3bN9THW6ICcHh97W9Z/U459eF59Er67Kd6KOLEC yQJopNvGNXOiQRZQFoaWn7RDJptkbZQTJc26gH9fc3JCjzUkjsQG3UyvWXDYkvTtIBak PaCg== X-Gm-Message-State: AKS2vOyC7BCPIRv48Cet4wSbbzthlfbyrgLh2QG0MiA/28qqTo8P+2ll mtUJD0xR440F65evjnk= X-Received: by 10.98.198.87 with SMTP id m84mr20288703pfg.122.1498794845974; Thu, 29 Jun 2017 20:54:05 -0700 (PDT) Received: from localhost ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id p76sm13087701pfa.53.2017.06.29.20.54.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Jun 2017 20:54:05 -0700 (PDT) From: Xin Long To: network dev , linux-sctp@vger.kernel.org Cc: Marcelo Ricardo Leitner , Neil Horman , davem@davemloft.net Subject: [PATCH net-next 10/11] sctp: remove the typedef sctp_inithdr_t Date: Fri, 30 Jun 2017 11:52:21 +0800 Message-Id: <311bd2b7c35122d71d8922700a1fddf9f0b4a5a1.1498794482.git.lucien.xin@gmail.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <029bbe69851dfbdc58ffa19e9712fa84d54eb9b5.1498794482.git.lucien.xin@gmail.com> References: <9b26ac600c9c3f9426b370ecd69261c25d220b2b.1498794482.git.lucien.xin@gmail.com> <2ae031641ce87e8fa77af7d3ea31b163f6c25f3d.1498794482.git.lucien.xin@gmail.com> <794094c6a1a0fdbf5374c983b2558e1316a51fd4.1498794482.git.lucien.xin@gmail.com> <81c68360c17817528e46216d9d48168b35e44434.1498794482.git.lucien.xin@gmail.com> <029bbe69851dfbdc58ffa19e9712fa84d54eb9b5.1498794482.git.lucien.xin@gmail.com> In-Reply-To: References: Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org This patch is to remove the typedef sctp_inithdr_t, and replace with struct sctp_inithdr in the places where it's using this typedef. Signed-off-by: Xin Long --- include/linux/sctp.h | 6 +++--- net/netfilter/nf_conntrack_proto_sctp.c | 4 ++-- net/sctp/sm_make_chunk.c | 4 ++-- net/sctp/sm_statefuns.c | 12 ++++++------ 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/linux/sctp.h b/include/linux/sctp.h index 91c888f..5624195 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h @@ -257,18 +257,18 @@ enum { SCTP_DATA_FRAG_MASK = 0x03, }; * This chunk is used to initiate a SCTP association between two * endpoints. */ -typedef struct sctp_inithdr { +struct sctp_inithdr { __be32 init_tag; __be32 a_rwnd; __be16 num_outbound_streams; __be16 num_inbound_streams; __be32 initial_tsn; __u8 params[0]; -} sctp_inithdr_t; +}; typedef struct sctp_init_chunk { struct sctp_chunkhdr chunk_hdr; - sctp_inithdr_t init_hdr; + struct sctp_inithdr init_hdr; } sctp_init_chunk_t; diff --git a/net/netfilter/nf_conntrack_proto_sctp.c b/net/netfilter/nf_conntrack_proto_sctp.c index b841a8a..31c6c8e 100644 --- a/net/netfilter/nf_conntrack_proto_sctp.c +++ b/net/netfilter/nf_conntrack_proto_sctp.c @@ -395,7 +395,7 @@ static int sctp_packet(struct nf_conn *ct, /* If it is an INIT or an INIT ACK note down the vtag */ if (sch->type == SCTP_CID_INIT || sch->type == SCTP_CID_INIT_ACK) { - sctp_inithdr_t _inithdr, *ih; + struct sctp_inithdr _inithdr, *ih; ih = skb_header_pointer(skb, offset + sizeof(_sch), sizeof(_inithdr), &_inithdr); @@ -471,7 +471,7 @@ static bool sctp_new(struct nf_conn *ct, const struct sk_buff *skb, /* Copy the vtag into the state info */ if (sch->type == SCTP_CID_INIT) { - sctp_inithdr_t _inithdr, *ih; + struct sctp_inithdr _inithdr, *ih; /* Sec 8.5.1 (A) */ if (sh->vtag) return false; diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c index 3ed2108..8b9ca10 100644 --- a/net/sctp/sm_make_chunk.c +++ b/net/sctp/sm_make_chunk.c @@ -217,7 +217,7 @@ struct sctp_chunk *sctp_make_init(const struct sctp_association *asoc, { struct net *net = sock_net(asoc->base.sk); struct sctp_endpoint *ep = asoc->ep; - sctp_inithdr_t init; + struct sctp_inithdr init; union sctp_params addrs; size_t chunksize; struct sctp_chunk *retval = NULL; @@ -385,7 +385,7 @@ struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *asoc, const struct sctp_chunk *chunk, gfp_t gfp, int unkparam_len) { - sctp_inithdr_t initack; + struct sctp_inithdr initack; struct sctp_chunk *retval; union sctp_params addrs; struct sctp_sock *sp; diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index 212fe76..71b6e3f 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c @@ -389,10 +389,10 @@ sctp_disposition_t sctp_sf_do_5_1B_init(struct net *net, } /* Grab the INIT header. */ - chunk->subh.init_hdr = (sctp_inithdr_t *)chunk->skb->data; + chunk->subh.init_hdr = (struct sctp_inithdr *)chunk->skb->data; /* Tag the variable length parameters. */ - chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t)); + chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr)); new_asoc = sctp_make_temp_asoc(ep, chunk, GFP_ATOMIC); if (!new_asoc) @@ -522,7 +522,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net, return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, commands); /* Grab the INIT header. */ - chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data; + chunk->subh.init_hdr = (struct sctp_inithdr *)chunk->skb->data; /* Verify the INIT chunk before processing it. */ err_chunk = NULL; @@ -576,7 +576,7 @@ sctp_disposition_t sctp_sf_do_5_1C_ack(struct net *net, /* Tag the variable length parameters. Note that we never * convert the parameters in an INIT chunk. */ - chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t)); + chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr)); initchunk = (sctp_init_chunk_t *) chunk->chunk_hdr; @@ -1454,10 +1454,10 @@ static sctp_disposition_t sctp_sf_do_unexpected_init( return sctp_sf_violation_chunklen(net, ep, asoc, type, arg, commands); /* Grab the INIT header. */ - chunk->subh.init_hdr = (sctp_inithdr_t *) chunk->skb->data; + chunk->subh.init_hdr = (struct sctp_inithdr *)chunk->skb->data; /* Tag the variable length parameters. */ - chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(sctp_inithdr_t)); + chunk->param_hdr.v = skb_pull(chunk->skb, sizeof(struct sctp_inithdr)); /* Verify the INIT chunk before processing it. */ err_chunk = NULL;