Changeset 5387 for pjproject/trunk/pjnath/src/pjnath-test/server.c
- Timestamp:
- Jul 15, 2016 3:02:09 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjnath/src/pjnath-test/server.c
r5350 r5387 58 58 PJ_ASSERT_RETURN(stun_cfg && domain && p_test_srv, PJ_EINVAL); 59 59 60 status = pj_gethostip(GET_AF(use_ipv6), &hostip); 61 if (status != PJ_SUCCESS) 62 return status; 60 if (use_ipv6) { 61 /* pj_gethostip() may return IPv6 link-local and will cause EINVAL 62 * error, so let's just hardcode it. 63 */ 64 pj_sockaddr_init(pj_AF_INET6(), &hostip, NULL, 0); 65 hostip.ipv6.sin6_addr.s6_addr[15] = 1; 66 } else { 67 status = pj_gethostip(GET_AF(use_ipv6), &hostip); 68 if (status != PJ_SUCCESS) 69 return status; 70 } 63 71 64 72 pool = pj_pool_create(mem, THIS_FILE, 512, 512, NULL); … … 502 510 /* Create relay socket */ 503 511 pj_sockaddr_init(GET_AF(use_ipv6), &alloc->alloc_addr, NULL, 0); 504 pj_gethostip(GET_AF(use_ipv6), &alloc->alloc_addr); 512 if (use_ipv6) { 513 /* pj_gethostip() may return IPv6 link-local and will cause EINVAL 514 * error, so let's just hardcode it. 515 */ 516 pj_sockaddr_init(pj_AF_INET6(), &alloc->alloc_addr, NULL, 0); 517 alloc->alloc_addr.ipv6.sin6_addr.s6_addr[15] = 1; 518 } else { 519 status = pj_gethostip(GET_AF(use_ipv6), &alloc->alloc_addr); 520 if (status != PJ_SUCCESS) { 521 pj_pool_release(alloc->pool); 522 pj_stun_msg_create_response(pool, req, PJ_STUN_SC_SERVER_ERROR, 523 NULL, &resp); 524 goto send_pkt; 525 } 526 } 505 527 506 528 status = pj_activesock_create_udp(alloc->pool, &alloc->alloc_addr, NULL,
Note: See TracChangeset
for help on using the changeset viewer.