GithubHelp home page GithubHelp logo

sctplab / sctp-refimpl Goto Github PK

View Code? Open in Web Editor NEW
8.0 8.0 2.0 56.57 MB

Automatically exported from code.google.com/p/sctp-refimpl

License: BSD 2-Clause "Simplified" License

Makefile 0.21% Shell 2.89% C 90.48% Assembly 0.01% C++ 3.13% HTML 0.33% Groff 1.75% Perl 0.05% PostScript 0.41% OpenEdge ABL 0.01% Objective-C 0.01% Java 0.01% Yacc 0.07% TeX 0.65% D 0.01%

sctp-refimpl's People

Contributors

tuexen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

deepak201589

sctp-refimpl's Issues

Build failure on linux with musl libc

The attached patches fix 3 build issues on a linux system with musl libc 
(http://musl-libc.org)

- musl is linux but does not have <sys/queue.h> by default. The first patch 
let's autoconf detect the presence of <sys/queue.h> and uses the fallback 
currently only used for Windows when not found

- musl does not have <sys/cdefs.h>. The header has mainly been used for macros 
for compatibility with pre-ANSI-C compilers. These macros (__BEGIN_DECLS, 
__END_DECLS and __P) are only used for FreeBSD. So make the include conditional 
on FreeBSD. It would also make sense to remove this cruft alltogether.

- musl follows POSIX and declares IPPORT_RESERVED in <netdb.h>. But <netdb.h> 
is never included in the source.


Original issue reported on code.google.com by janda.felix on 25 Feb 2015 at 9:04

Attachments:

Add CMakeLists.txt to KERN/usrsctp/usrsctplib

it makes adding usrsctplib to other project with cmake build system very easy.

here example with almost anything ported from configure.ac:
https://github.com/proller/freeminer/blob/sctp/util/usrsctplib_CMakeLists.txt

Original issue reported on code.google.com by [email protected] on 10 May 2015 at 4:29

Build in android

android ndk have no <ifaddrs.h>

stupid working solution:
get ifaddrs.h ifaddrs.c from here:
https://github.com/kmackay/android-ifaddrs

and

--- a/netinet/sctp_os_userspace.h
+++ b/netinet/sctp_os_userspace.h
@@ -496,8 +496,12 @@ struct sx {int dummy;};
 #include <sys/types.h>
 #if !defined(__Userspace_os_Windows)
 #if defined(INET) || defined(INET6)
+#if defined(__ANDROID__)
+#include "ifaddrs.h"
+#else
 #include <ifaddrs.h>
 #endif
+#endif

Original issue reported on code.google.com by [email protected] on 4 May 2015 at 7:08

Overflow with memcpy() in Win_getifaddrs()

sctp_userspace.c 144

struct sockaddr_in *addr;
...
addr = (struct sockaddr_in *)malloc(sizeof(struct sockaddr_in));
...
memcpy(&addr, &pAdapt->FirstUnicastAddress->Address.lpSockaddr, sizeof(struct 
sockaddr_in));

I think should be:
memcpy(addr, &pAdapt->FirstUnicastAddress->Address.lpSockaddr, sizeof(struct 
sockaddr_in));

--------------------------
Same with
#if defined(INET6)
        struct sockaddr_in6 *addr6;
#endif

Original issue reported on code.google.com by [email protected] on 14 Apr 2014 at 10:01

Cannot bind to loopback address (127.0.0.1 or ::1) on Windows

What steps will reproduce the problem?
Just bind to a loopback address.

What is the expected output? What do you see instead?
It failed with errno set to EADDRNOTAVAIL.

What version of the product are you using? On what operating system?
r9298, Windows 7 x64 (the library is compiled into x86)

Please provide any additional information below.

I think it failed because no interface could be found with a loopback address 
on Windows.
I took a look into the code and found that the function returns at 
sctp_pcb.c:3752.

Original issue reported on code.google.com by [email protected] on 11 Jul 2015 at 9:39

Documentation of the client example program misses the local port number parameter

What steps will reproduce the problem?
1. Compile under windows
2. Run example echo_server and client

What is the expected output? What do you see instead?
Client is getting stuck on usrsctp_connect, no connection attempt appears to be 
sent and no error is returned from the call. 

What version of the product are you using? On what operating system?
Windows 7 64 bit

Please provide any additional information below.
compiled and tested on 2 different machines, the same problem occurs. 

Original issue reported on code.google.com by [email protected] on 11 Dec 2014 at 4:21

Crash after usrsctp_finish() is called

What steps will reproduce the problem?
1. Establish an association
2. Call usrsctp_finish() on main thread

What is the expected output? What do you see instead?
Crash happens on internal thread:
#5  0x00007fff831cd78d in szone_free_definite_size ()
#6  0x00000001000a3047 in sctp_free_assoc at 
/Users/mrubenchik/Work/3rdparty/sctp-refimpl-read-only/KERN/usrsctp/usrsctplib/n
etinet/sctp_pcb.c:5873
#7  0x00000001000baa63 in sctp_timeout_handler at 
/Users/mrubenchik/Work/3rdparty/sctp-refimpl-read-only/KERN/usrsctp/usrsctplib/n
etinet/sctputil.c:1927
#8  0x000000010006ec81 in sctp_handle_tick [inlined] at 
/Users/mrubenchik/Work/3rdparty/sctp-refimpl-read-only/KERN/usrsctp/usrsctplib/n
etinet/sctp_callout.c:155
#9  0x000000010006ec33 in user_sctp_timer_iterate at 
/Users/mrubenchik/Work/3rdparty/sctp-refimpl-read-only/KERN/usrsctp/usrsctplib/n
etinet/sctp_callout.c:194
#10 0x00007fff83d87268 in _pthread_body ()
#11 0x00007fff83d871e5 in _pthread_start ()
#12 0x00007fff83d8541d in thread_start ()


What version of the product are you using? On what operating system?
OSX 10.10.3
sctp latest repo on June 25th 2015


Please provide any additional information below.
    if (asoc->mapping_array) {
        SCTP_FREE(asoc->mapping_array, SCTP_M_MAP);
        asoc->mapping_array = NULL;
    }

Original issue reported on code.google.com by [email protected] on 25 Jun 2015 at 3:13

usrsctp does not build with mingw

usrsctp does not build with mingw.  Various errors including "sys/socket.h" 
appear during build.  If -D__Userspace_os_Windows is set as a Cflag it will not 
build due to differences between GCC and MSVC. Mingw should be a supported 
compiler.


Original issue reported on code.google.com by [email protected] on 15 May 2015 at 10:32

Add support for building with clang-cl

I have a patch to work around http://llvm.org/bugs/show_bug.cgi?id=20177 and 
http://llvm.org/bugs/show_bug.cgi?id=20178 in order to fix building SCTP with 
clang-cl for Firefox.

Original issue reported on code.google.com by [email protected] on 2 Jul 2014 at 6:23

Attachments:

Crashes on Windows with unreliable sending

Crashes on Windows in Chrome in usrsctp.  Only on Windows, with high 
correlation with usage of unreliable messages.  We've been unable to reproduce 
on other platforms.

We've been tracking it here: 
https://code.google.com/p/webrtc/issues/detail?id=4084.  There's a few stack 
traces there and more comments.  Please ping me for any more details that you 
need!

Original issue reported on code.google.com by [email protected] on 17 Mar 2015 at 9:03

Memory leak: usrsctp_conninput doesn't free mbuf *m

There is a memory leak in usrsctp/usrsctplib/user_socket.c in function 
usrsctp_conninput
The memory allocated here:
"if ((m = sctp_get_mbuf_for_msg(length, 1, M_NOWAIT, 0, MT_DATA)) == NULL)" 
(line 3200 in current rev)
is never released

I think a simple sctp_m_freem before the return would fix it, but I'm not very 
familiar with the code

Original issue reported on code.google.com by [email protected] on 6 Jan 2014 at 3:32

Not working while using alias IP in windows for IPv6

What steps will reproduce the problem?
1.Add an alias IPv6 to an interface in some windows machine
2.Create socket for IPv6 and bind using the alias ip
3.Try to establish connection in client mode with some other SCTP server

What is the expected output? What do you see instead?
== The initial INIT packet should originate from the alias IPv6 used during 
bind, but the source IPv6 found to be the primary IPv6 of that interface and 
eventually it aborts the connection after receiving INIT_ACK from the peer node.

What version of the product are you using? On what operating system?
== I am using the revision 9168 (latest as of now) of the product in Windows 7 
ultimate 64-bit machine.

Please provide any additional information below.
== The library works fine for alias IPs when used for IPv4

Original issue reported on code.google.com by [email protected] on 18 Feb 2015 at 3:53

Can I get the peer's UDP encapsulation port?

All of the examples set up a remote encapsulation port before transmission. But 
can I get the peer's UDP port number from a message? It's necessary for 
Peer-to-Peer networking.

Original issue reported on code.google.com by [email protected] on 4 Jun 2015 at 3:11

cosmetic issue: printf format warning for tv.tv_usec in usrsctplib/user_socket.c

What steps will reproduce the problem?
1. bootstrap/configure/make KERN/usrsctp on mint linux (based on ubuntu 12.10)
2. Compilation fails in usrsctplib/user_socket.c
user_socket.c: In function 'usrsctp_dumppacket':
user_socket.c:3122:11: error: format '%d' expects argument of type 'int', but 
argument 8 has type '__suseconds_t' [-Werror=format]

tv_usec is suseconds_t which may be defined differently on different platforms. 
One way to deal with this is to print tv_usec as %jd and typecast argument to 
intmax_t. See attached patch.



Original issue reported on code.google.com by [email protected] on 7 Jan 2013 at 10:46

Attachments:

Crash when closing large number of channels

I have created a C/C++ library which does WebRTC data channels. Part of the 
tests is to open and close hundreds on channels. When closing 100+ channels 
from the browser in a quick succession, the sctp library does a double memory 
deallocation.
I have attached the stack trace.

I am using revision 9200 of the library.

Best regards,
Andrei

Original issue reported on code.google.com by [email protected] on 25 Mar 2015 at 1:12

Attachments:

INET INET6 and similar defines are not included in the userspace library header

What steps will reproduce the problem?
1. Compile usrscpt with INET and INET6
2. Link library in Xcode
3. Stack of some functions/callbacks will be corrupted due to INET and INET6 
not being defined in Xcode. For example sctp_sockstore will be inconsistent.

What is the expected output? What do you see instead?
I think it is expected from the library to define symbols like INET and INET6 
with library prefix, i.e. REFSCTP_INET REFSCTP_INET6 and include the symbol in 
the user header file. Otherwise one has no idea what flags were used to 
configure and build the library.

What version of the product are you using? On what operating system?
Revision 9168 on OSX

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 19 Feb 2015 at 4:15

libusrsctp is not building for iOS

What steps will reproduce the problem?
1. Try to compile using attached buildiOS.sh that has iOS build setup

What is the expected output? What do you see instead?
Expect library to compile, instead get an error of missing include:

In file included from user_socket.c:35:
In file included from ./netinet/sctp_os.h:72:
./netinet/sctp_os_userspace.h:491:10: fatal error: 'netinet/ip_icmp.h' file not 
found
#include <netinet/ip_icmp.h>

What version of the product are you using? On what operating system?

Latest SVN checkout as of Feb 11 2015

Please provide any additional information below.

Diff file below fixes the problem. It disables include when not using inet and 
inet6.
Also people might find handy the build script for iOs

Original issue reported on code.google.com by [email protected] on 11 Feb 2015 at 6:26

Attachments:

kernel crash when addip_enable=1 and default_auto_asconf=1

tested in os: 
FreeBSD 10.1-RELEASE 
Linux odroid 3.8.13.30

openssh with sctp patch (from freebsd ports)
https://gist.github.com/proller/22597d546615eed04ec1

sysctl:
net.sctp.addip_enable=1                                                         


net.sctp.auth_enable=1                                                          


net.sctp.default_auto_asconf=1

use 2 adapters: lan + wifi 

make connection:
host_one: 
echo "Transport sctp" >> /usr/local/etc/sshd_config
/usr/local/sbin/sshd

host_two: ssh -z host_one

in ssh run something changing like 
ping 8.8.8.8 

now remove usb wifi adapter (or disable wifi switch on notebook)
here expecting available ssh connection 
but usually os in one host crashes

no problems (and simple disconnect) when sysctl not tuned

Original issue reported on code.google.com by [email protected] on 29 Apr 2015 at 6:00

Unreliable code hosting - move to GitHub?

What steps will reproduce the problem?
1. Try to check out code from code.google.com svn repo
2. Checkout fails

What is the expected output? What do you see instead?
Expected: Checkout succeeds reliably every time.
Observed: Checkout fails.

Please provide any additional information below.

As Google is shutting down code.google.com and the svn repo is unreliable when 
checking out, could the repo be moved to, say, GitHub?

Original issue reported on code.google.com by [email protected] on 2 Apr 2015 at 8:51

How connect to server in self process?

I have one app (game for example) with 3 working modes:
client
server
server with connected client (singleplayer)

first two works, but i cant connect to socket created in my process earlier



======
listening on :::55298.

SCTP: add HMAC id 1 to list
SCTP: added chunk 193 (0xc1) to Auth list
SCTP: added chunk 128 (0x80) to Auth list
Waiting for connections on port 55298
Bind called port: 55298
Addr: IPv6 address: 0:0:0:0:0:0:0:0:port:55298 scope:0
Main hash to bind at head:0x7f2fc0022190, bound port:55298 - in tcp_pool=0


SCTP: add HMAC id 1 to list
SCTP: added chunk 193 (0xc1) to Auth list
SCTP: added chunk 128 (0x80) to Auth list

Main hash to bind at head:0x7f2f94022a50, bound port:65095 - in tcp_pool=0
Allocate an association for peer:IPv6 address: 0:0:0:0:0:0:0:1:port:55298 
scope:0
Port:55298
Adding an address (from:1) to the peer: IPv6 address: 
0:0:0:0:0:0:0:1:port:55298 scope:0
Association 0x7f2f94027630 now allocated
Sending INIT
Sending INIT - calls lowlevel_output
Select source addr for:IPv6 address: 0:0:0:0:0:0:0:1:port:55298 scope:0
ifn from route:(nil) ifn_index:1
ifn_index:1 name:lo is emit interface
Is destination preferred:IPv6 address: 0:0:0:0:0:0:0:1:port:0 scope:0
src_loop:1 src_priv:0 src_glob:0
dest_loop:1 dest_priv:0 dest_glob:0
YES
Found 1 preferred source addresses for intf:lo
cur_addr_num:0
Is destination preferred:IPv6 address: 0:0:0:0:0:0:0:1:port:0 scope:0
src_loop:1 src_priv:0 src_glob:0
dest_loop:1 dest_priv:0 dest_glob:0
YES
Calling ipv6 output routine from low level
src: IPv6 address: 0:0:0:0:0:0:0:1:port:65095 scope:0
dst: IPv6 address: 0:0:0:0:0:0:0:1:port:55298 scope:0
return from send is 0
lowlevel_output - 0
recv_function_udp6: Received 236 bytes. - calling sctp_common_input_processing 
with off=12
stcb:(nil) inp:(nil)
stcb is (nil)


recv_function_udp6: Received 16 bytes. - calling sctp_common_input_processing 
with off=12
Ok, Common input processing called, m:0x7f2f900009d0 iphlen:0 offset:12 
length:16 stcb:0x7f2f94027630
stcb:0x7f2f94027630 state:2
sctp_process_control: iphlen=0, offset=12, length=16 stcb:0x7f2f94027630
sctp_process_control: processing a chunk type=6, len=4
SCTP_ABORT, stcb 0x7f2f94027630
sctp_handle_abort: handling ABORT
sctp_handle_abort: finished
Notification of length 24 received.

Association change SCTP_CANT_STR_ASSOC, streams (in/out) = (0/10), ABORT = 0x06 
0x00 0x00 0x04.
Timer type 16 goes off
Timer now complete (type 0)
Unified Inventory. inventory size: 225
Send called addr:(nil) send length 27
usrsctp_sendv: No such file or directory
======


i found some magic about creating and binding two udp sockets and passing them 
to usrsctp_socket
https://code.google.com/p/sctp-refimpl/source/browse/trunk/KERN/usrsctp/programs
/ekr_loop.c#352
but it seems overly complicated

Original issue reported on code.google.com by [email protected] on 14 Jul 2015 at 1:02

Memory leak for incoming connection in TCP typed listener

What steps will reproduce the problem?
1. Have non blocking TCP type listening socket
2. Establish a new connection to this socket. sonewconn is called which does 
not set so_count to 1 for the new connection
3. Call usrsctp_close which does not release memory because so_count is already 
0

What is the expected output? What do you see instead?
Expect usrsctp_close to free memory

What version of the product are you using? On what operating system?
Lasted SVN as of June 04 2015


Original issue reported on code.google.com by [email protected] on 4 Jun 2015 at 7:26

Cross compiling with mingw-w64

I discovered two issues about sctp when cross compiling mozilla sources with 
mingw.

- Using lower case includes
While this doesn't matter on Windows, where filesystem is case insensitive, for 
cross compiling it's important. mingw always uses lower cased file names.

- Support for NOMINMAX
This is not really related to mingw, but Windows in general. While min/max 
macros are provided by system headers, they may be disabled with NOMINMAX 
macro. It has to be taken into account in sources, where those macros are 
defined. My proposed patch checks for NOMINMAX, but maybe something like 
|#ifndef min| would be prefered.

Please see the attached patch.

Original issue reported on code.google.com by [email protected] on 8 Jul 2015 at 5:03

Attachments:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.