All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	lksctp <linux-sctp@vger.kernel.org>
Subject: [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter
Date: Tue, 19 Apr 2011 05:11:47 +0000	[thread overview]
Message-ID: <4DAD1993.5070801@cn.fujitsu.com> (raw)
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>

The 'p' member of struct sctp_paramhdr is common part for
IPv4 addr parameter and IPv6 addr parameter in union sctp_addr_param.

For addr-related code, use specified addr parameter.
Otherwise, use common header to access type/length member.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/input.c         |    2 +-
 net/sctp/sm_make_chunk.c |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/sctp/input.c b/net/sctp/input.c
index 5436c69..30cec77 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -1017,7 +1017,7 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
 	/* Skip over the ADDIP header and find the Address parameter */
 	param = (union sctp_addr_param *)(asconf + 1);
 
-	af = sctp_get_af_specific(param_type2af(param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(param->p.type));
 	if (unlikely(!af))
 		return NULL;
 
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index b3434cc..844adfd 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2923,7 +2923,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 	    asconf_param->param_hdr.type != SCTP_PARAM_SET_PRIMARY)
 		return SCTP_ERROR_UNKNOWN_PARAM;
 
-	switch (addr_param->v4.param_hdr.type) {
+	switch (addr_param->p.type) {
 	case SCTP_PARAM_IPV6_ADDRESS:
 		if (!asoc->peer.ipv6_address)
 			return SCTP_ERROR_DNS_FAILED;
@@ -2936,7 +2936,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 		return SCTP_ERROR_DNS_FAILED;
 	}
 
-	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(addr_param->p.type));
 	if (unlikely(!af))
 		return SCTP_ERROR_DNS_FAILED;
 
@@ -3100,7 +3100,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
 	/* Skip the address parameter and store a pointer to the first
 	 * asconf parameter.
 	 */
-	length = ntohs(addr_param->v4.param_hdr.length);
+	length = ntohs(addr_param->p.length);
 	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
 	chunk_len -= length;
 
@@ -3177,7 +3177,7 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
 			((void *)asconf_param + sizeof(sctp_addip_param_t));
 
 	/* We have checked the packet before, so we do not check again.	*/
-	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(addr_param->p.type));
 	af->from_addr_param(&addr, addr_param, htons(bp->port), 0);
 
 	switch (asconf_param->param_hdr.type) {
@@ -3304,7 +3304,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
 	/* Skip the address parameter in the last asconf sent and store a
 	 * pointer to the first asconf parameter.
 	 */
-	length = ntohs(addr_param->v4.param_hdr.length);
+	length = ntohs(addr_param->p.length);
 	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
 	asconf_len -= length;
 
-- 
1.6.5.2



WARNING: multiple messages have this Message-ID (diff)
From: Wei Yongjun <yjwei@cn.fujitsu.com>
To: David Miller <davem@davemloft.net>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	lksctp <linux-sctp@vger.kernel.org>
Subject: [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code
Date: Tue, 19 Apr 2011 13:11:47 +0800	[thread overview]
Message-ID: <4DAD1993.5070801@cn.fujitsu.com> (raw)
In-Reply-To: <4DAD18AB.3040401@cn.fujitsu.com>

From: Shan Wei <shanwei@cn.fujitsu.com>

The 'p' member of struct sctp_paramhdr is common part for
IPv4 addr parameter and IPv6 addr parameter in union sctp_addr_param.

For addr-related code, use specified addr parameter.
Otherwise, use common header to access type/length member.

Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com>
---
 net/sctp/input.c         |    2 +-
 net/sctp/sm_make_chunk.c |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/sctp/input.c b/net/sctp/input.c
index 5436c69..30cec77 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -1017,7 +1017,7 @@ static struct sctp_association *__sctp_rcv_asconf_lookup(
 	/* Skip over the ADDIP header and find the Address parameter */
 	param = (union sctp_addr_param *)(asconf + 1);
 
-	af = sctp_get_af_specific(param_type2af(param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(param->p.type));
 	if (unlikely(!af))
 		return NULL;
 
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index b3434cc..844adfd 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2923,7 +2923,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 	    asconf_param->param_hdr.type != SCTP_PARAM_SET_PRIMARY)
 		return SCTP_ERROR_UNKNOWN_PARAM;
 
-	switch (addr_param->v4.param_hdr.type) {
+	switch (addr_param->p.type) {
 	case SCTP_PARAM_IPV6_ADDRESS:
 		if (!asoc->peer.ipv6_address)
 			return SCTP_ERROR_DNS_FAILED;
@@ -2936,7 +2936,7 @@ static __be16 sctp_process_asconf_param(struct sctp_association *asoc,
 		return SCTP_ERROR_DNS_FAILED;
 	}
 
-	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(addr_param->p.type));
 	if (unlikely(!af))
 		return SCTP_ERROR_DNS_FAILED;
 
@@ -3100,7 +3100,7 @@ struct sctp_chunk *sctp_process_asconf(struct sctp_association *asoc,
 	/* Skip the address parameter and store a pointer to the first
 	 * asconf parameter.
 	 */
-	length = ntohs(addr_param->v4.param_hdr.length);
+	length = ntohs(addr_param->p.length);
 	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
 	chunk_len -= length;
 
@@ -3177,7 +3177,7 @@ static void sctp_asconf_param_success(struct sctp_association *asoc,
 			((void *)asconf_param + sizeof(sctp_addip_param_t));
 
 	/* We have checked the packet before, so we do not check again.	*/
-	af = sctp_get_af_specific(param_type2af(addr_param->v4.param_hdr.type));
+	af = sctp_get_af_specific(param_type2af(addr_param->p.type));
 	af->from_addr_param(&addr, addr_param, htons(bp->port), 0);
 
 	switch (asconf_param->param_hdr.type) {
@@ -3304,7 +3304,7 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
 	/* Skip the address parameter in the last asconf sent and store a
 	 * pointer to the first asconf parameter.
 	 */
-	length = ntohs(addr_param->v4.param_hdr.length);
+	length = ntohs(addr_param->p.length);
 	asconf_param = (sctp_addip_param_t *)((void *)addr_param + length);
 	asconf_len -= length;
 
-- 
1.6.5.2



  parent reply	other threads:[~2011-04-19  5:11 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-19  5:07 [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del Wei Yongjun
2011-04-19  5:07 ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun
2011-04-19  5:09 ` [PATCH net-next-2.6 1/8] sctp: delete unused macro definition of Wei Yongjun
2011-04-19  5:09   ` [PATCH net-next-2.6 1/8] sctp: delete unused macro definition of sctp_chunk_is_control Wei Yongjun
2011-04-19  5:19   ` [PATCH net-next-2.6 1/8 v2] sctp: delete unused macro definition Wei Yongjun
2011-04-19  5:19     ` [PATCH net-next-2.6 1/8 v2] sctp: delete unused macro definition of sctp_chunk_is_control Wei Yongjun
2011-04-20  4:47     ` [PATCH net-next-2.6 1/8 v2] sctp: delete unused macro David Miller
2011-04-20  4:47       ` [PATCH net-next-2.6 1/8 v2] sctp: delete unused macro definition of sctp_chunk_is_control David Miller
2011-04-19  5:11 ` [PATCH net-next-2.6 2/8] sctp: fix the comment of sctp_sf_violation_paramlen() Wei Yongjun
2011-04-19  5:11   ` Wei Yongjun
2011-04-20  4:47   ` [PATCH net-next-2.6 2/8] sctp: fix the comment of David Miller
2011-04-20  4:47     ` [PATCH net-next-2.6 2/8] sctp: fix the comment of sctp_sf_violation_paramlen() David Miller
2011-04-19  5:11 ` Wei Yongjun [this message]
2011-04-19  5:11   ` [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code Wei Yongjun
2011-04-20  4:47   ` [PATCH net-next-2.6 3/8] sctp: use common head of addr David Miller
2011-04-20  4:47     ` [PATCH net-next-2.6 3/8] sctp: use common head of addr parameter to access member in addr-unrelated code David Miller
2011-04-19  5:12 ` [PATCH net-next-2.6 4/8] sctp: kill abandoned SCTP_CMD_TRANSMIT command Wei Yongjun
2011-04-19  5:12   ` Wei Yongjun
2011-04-20  4:47   ` [PATCH net-next-2.6 4/8] sctp: kill abandoned David Miller
2011-04-20  4:47     ` [PATCH net-next-2.6 4/8] sctp: kill abandoned SCTP_CMD_TRANSMIT command David Miller
2011-04-19  5:13 ` [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from Wei Yongjun
2011-04-19  5:13   ` [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from userspace Wei Yongjun
2011-04-20  4:47   ` [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data David Miller
2011-04-20  4:47     ` [PATCH net-next-2.6 5/8] sctp: use memdup_user to copy data from userspace David Miller
2011-04-19  5:13 ` [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed Wei Yongjun
2011-04-19  5:13   ` [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed transports Wei Yongjun
2011-04-20  4:47   ` [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about David Miller
2011-04-20  4:47     ` [PATCH net-next-2.6 6/8] sctp: teach CACC algorithm about removed transports David Miller
2011-04-19  5:14 ` [PATCH net-next-2.6 7/8] sctp: Allow bindx_del to accept 0 port Wei Yongjun
2011-04-19  5:14   ` Wei Yongjun
2011-04-20  4:47   ` David Miller
2011-04-20  4:47     ` David Miller
2011-04-19  5:15 ` [PATCH net-next-2.6 8/8] sctp: Release all routes when processing Wei Yongjun
2011-04-19  5:15   ` [PATCH net-next-2.6 8/8] sctp: Release all routes when processing acks ADD_IP or DEL_IP Wei Yongjun
2011-04-20  4:47   ` [PATCH net-next-2.6 8/8] sctp: Release all routes when David Miller
2011-04-20  4:47     ` [PATCH net-next-2.6 8/8] sctp: Release all routes when processing acks ADD_IP or DEL_IP David Miller
2011-04-19  5:31 ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for Shan Wei
2011-04-19  5:31   ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Shan Wei
2011-04-19  8:10 ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for Nicolas Dichtel
2011-04-19  8:10   ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Nicolas Dichtel
2011-04-19  8:18   ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for Wei Yongjun
2011-04-19  8:18     ` [PATCH net-next-2.6 0/8] sctp: some cleanup and tiny fix for add/del ip Wei Yongjun

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4DAD1993.5070801@cn.fujitsu.com \
    --to=yjwei@cn.fujitsu.com \
    --cc=davem@davemloft.net \
    --cc=linux-sctp@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.