summaryrefslogtreecommitdiff
path: root/net/sctp
diff options
context:
space:
mode:
authorSaran Maruti Ramanara <saran.neti@telus.com>2015-01-29 13:05:58 +0300
committerZefan Li <lizefan@huawei.com>2015-04-14 12:34:00 +0300
commit6b4a9a084334717868e054002ad7863a3b4cceef (patch)
treec2b8d47c56a4f8160b41a93202210d541864645c /net/sctp
parent999a6c8f6f5188b1b58404dfb41cd4248e13d32c (diff)
downloadlinux-6b4a9a084334717868e054002ad7863a3b4cceef.tar.xz
net: sctp: fix passing wrong parameter header to param_type2af in sctp_process_param
commit cfbf654efc6d78dc9812e030673b86f235bf677d upstream. When making use of RFC5061, section 4.2.4. for setting the primary IP address, we're passing a wrong parameter header to param_type2af(), resulting always in NULL being returned. At this point, param.p points to a sctp_addip_param struct, containing a sctp_paramhdr (type = 0xc004, length = var), and crr_id as a correlation id. Followed by that, as also presented in RFC5061 section 4.2.4., comes the actual sctp_addr_param, which also contains a sctp_paramhdr, but this time with the correct type SCTP_PARAM_IPV{4,6}_ADDRESS that param_type2af() can make use of. Since we already hold a pointer to addr_param from previous line, just reuse it for param_type2af(). Fixes: d6de3097592b ("[SCTP]: Add the handling of "Set Primary IP Address" parameter to INIT") Signed-off-by: Saran Maruti Ramanara <saran.neti@telus.com> Signed-off-by: Daniel Borkmann <dborkman@redhat.com> Acked-by: Vlad Yasevich <vyasevich@gmail.com> Acked-by: Neil Horman <nhorman@tuxdriver.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Zefan Li <lizefan@huawei.com>
Diffstat (limited to 'net/sctp')
-rw-r--r--net/sctp/sm_make_chunk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sctp/sm_make_chunk.c b/net/sctp/sm_make_chunk.c
index 83594898569a..f1249b36837c 100644
--- a/net/sctp/sm_make_chunk.c
+++ b/net/sctp/sm_make_chunk.c
@@ -2569,7 +2569,7 @@ do_addr_param:
addr_param = param.v + sizeof(sctp_addip_param_t);
- af = sctp_get_af_specific(param_type2af(param.p->type));
+ af = sctp_get_af_specific(param_type2af(addr_param->p.type));
if (af == NULL)
break;