aboutsummaryrefslogtreecommitdiffstats
path: root/net/sctp/bind_addr.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sctp/bind_addr.c')
-rw-r--r--net/sctp/bind_addr.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/sctp/bind_addr.c b/net/sctp/bind_addr.c
index 2b36e4238170..9085e531d575 100644
--- a/net/sctp/bind_addr.c
+++ b/net/sctp/bind_addr.c
@@ -181,10 +181,13 @@ int sctp_del_bind_addr(struct sctp_bind_addr *bp, union sctp_addr *del_addr)
181{ 181{
182 struct list_head *pos, *temp; 182 struct list_head *pos, *temp;
183 struct sctp_sockaddr_entry *addr; 183 struct sctp_sockaddr_entry *addr;
184 union sctp_addr tmp;
185
186 flip_to_n(&tmp, del_addr);
184 187
185 list_for_each_safe(pos, temp, &bp->address_list) { 188 list_for_each_safe(pos, temp, &bp->address_list) {
186 addr = list_entry(pos, struct sctp_sockaddr_entry, list); 189 addr = list_entry(pos, struct sctp_sockaddr_entry, list);
187 if (sctp_cmp_addr_exact(&addr->a_h, del_addr)) { 190 if (sctp_cmp_addr_exact(&addr->a, &tmp)) {
188 /* Found the exact match. */ 191 /* Found the exact match. */
189 list_del(pos); 192 list_del(pos);
190 kfree(addr); 193 kfree(addr);
@@ -304,10 +307,12 @@ int sctp_bind_addr_match(struct sctp_bind_addr *bp,
304{ 307{
305 struct sctp_sockaddr_entry *laddr; 308 struct sctp_sockaddr_entry *laddr;
306 struct list_head *pos; 309 struct list_head *pos;
310 union sctp_addr tmp;
307 311
312 flip_to_n(&tmp, addr);
308 list_for_each(pos, &bp->address_list) { 313 list_for_each(pos, &bp->address_list) {
309 laddr = list_entry(pos, struct sctp_sockaddr_entry, list); 314 laddr = list_entry(pos, struct sctp_sockaddr_entry, list);
310 if (opt->pf->cmp_addr(&laddr->a_h, addr, opt)) 315 if (opt->pf->cmp_addr(&laddr->a, &tmp, opt))
311 return 1; 316 return 1;
312 } 317 }
313 318
@@ -334,14 +339,12 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp,
334 339
335 addr_buf = (union sctp_addr *)addrs; 340 addr_buf = (union sctp_addr *)addrs;
336 for (i = 0; i < addrcnt; i++) { 341 for (i = 0; i < addrcnt; i++) {
337 union sctp_addr tmp;
338 addr = (union sctp_addr *)addr_buf; 342 addr = (union sctp_addr *)addr_buf;
339 af = sctp_get_af_specific(addr->v4.sin_family); 343 af = sctp_get_af_specific(addr->v4.sin_family);
340 if (!af) 344 if (!af)
341 return NULL; 345 return NULL;
342 flip_to_h(&tmp, addr);
343 346
344 if (opt->pf->cmp_addr(&laddr->a_h, &tmp, opt)) 347 if (opt->pf->cmp_addr(&laddr->a, addr, opt))
345 break; 348 break;
346 349
347 addr_buf += af->sockaddr_len; 350 addr_buf += af->sockaddr_len;