Commit Graph

868 Commits

Author SHA1 Message Date
Sebastian Huber
f97536dcd3 basdefs.h: Add and use RTEMS_UNUSED 2015-10-26 09:13:19 +01:00
Martin Galvan
28a870c47f cpukit/libnetworking/rtems/rtems_dhcp.c: Fix compilation error
Apparently 'free' is defined as a macro which takes two arguments and calls
rtems_bsdnet_free. When fixing #2405 I added a missing 'free' but didn't notice
it was non-standard.

Closes #2410.
2015-09-03 15:42:41 -05:00
Martin Galvan
c83bad2fc4 cpukit/libnetworking/rtems/rtems_dhcp.c: Fix leak on realloc failure for dhcp_hostname.
Closes #2405.
2015-09-03 11:28:10 -05:00
Michael Davidsaver
74ef2c101a tftpDriver: close() false error
closes #2376.
2015-07-29 10:56:14 -05:00
Chris Johns
083e6d6b4b libnetworking: Send the hostname if set in the network configuration.
This allows a suitably configured DHCP server with DDNS to enter
the name into the DNS table making it addressiable via it's host name.
2015-07-14 08:15:52 +10:00
Alexander Krutwig
7cd2484c4c timecounter: Use in RTEMS
Replace timestamp implementation with FreeBSD bintime and timecounters.

New test sptests/sptimecounter02.

Update #2271.
2015-05-20 08:40:33 +02:00
Sebastian Huber
4438ac2575 score: Fine grained locking for mutexes
Update #2273.
2015-05-19 12:00:47 +02:00
Sebastian Huber
4db0ae8e07 score: _Objects_Get_isr_disable()
Use ISR_lock_Context instead of ISR_Level to allow use of ISR locks for
low-level locking.

Update #2273.
2015-04-21 08:25:31 +02:00
Sebastian Huber
bf11690ca2 network: Avoid clash with FreeBSD <sys/time.h> 2015-03-09 13:16:06 +01:00
Chris Johns
ee87007748 Panic on RTEMS_FAST_MUTEX network semaphore claim/release.
Fix the code to panic rather than perform a bad access if the network
semaphore is accessed without the stack being intialised.

Closes #2229.
2015-02-24 12:53:29 -05:00
Till Straumann
25e14e3193 networking: alignment exception in ioctl(SIOCGIFCONF)
Access memory using a byte stream when copying to avoid unaligned
access. update #1401
2015-02-23 10:49:50 -05:00
Joel Sherrill
547c2282ee sys/socket.h: Include <sys/types.h> for ssize_t
closes 2245
2015-02-12 15:23:33 -06:00
Sebastian Huber
eb7753437f Filesystem: Delete unused fsmountme_h handler 2015-02-09 15:38:48 +01:00
Sebastian Huber
ec0f2df19b Filesystem: Use rtems_libio_iop_to_descriptor()
Drop parameter check from previously unused
rtems_libio_iop_to_descriptor().
2015-02-04 14:03:49 +01:00
Joel Sherrill
081a6971d9 sys/socket.h: Add include of <sys/_types.h> for ssize_t
This was needed to make it possible to only include <sys/socket.h>
for the methods in this file in compliance with the POSIX
specification. This was identified by the Open Group FACE
Conformance Test Suite.

Close 2245.
2015-01-23 09:46:59 -06:00
Sebastian Huber
c8cd4ff52b libnetworking: Fix memset() call
Close #2244.
2015-01-23 12:56:53 +01:00
Sebastian Huber
c625a64121 Filesystem: Delete node type operation
Use the fstat handler instead.
2015-01-22 07:52:40 +01:00
Sebastian Huber
f87ede57a2 libnetworking: Fix close of active sockets
Send a special event to notify tasks waiting for a socket state change
in case this socket gets closed.  This prevents a use after free.

Close #785.
2015-01-20 07:11:58 +01:00
Sebastian Huber
51c88e8bf4 libnetworking: Delete dead code
The so_uid is always 0 in RTEMS.
2015-01-20 07:08:30 +01:00
Sebastian Huber
f2f39f3c92 libnetworking: Avoid spurious event delivery
The so_pgid field contains the task identifier if this task waits for
the SOSLEEP_EVENT event.  Do not inherit this from the accept socket.
2015-01-20 07:08:30 +01:00
Sebastian Huber
ac6e8c404f libnetworking: Simplify sbwait() 2015-01-15 11:30:13 +01:00
Peter Dufault
da10694a48 libnetworking: Make rtems_dhcp_failsafe() run time configurable
rtems_dhcp_failsafe() can be configured at compile time with
various options. This change makes it possible to instead configure
it at runtime.

This will make it marginally larger. I haven't measured the difference
but I'll guess it's in the lower hundreds of bytes. The change could be
modified to leave it either compile time or run time configurable,
I prefer the simplicity of a single method.

closes #1905
2014-12-23 22:14:50 -05:00
Daniel Cederman
69e3f272d9 net: Add network task affinity config
This patch adds a default network tasks CPU affinity configuration
option. The network drivers have the option to create their own
daemon tasks with a custom CPU affinity set, or rely on the
default set.
2014-12-02 13:41:15 +01:00
Chris Johns
7ae1c30cc8 libnetworking: Fix the sethostname decl to match newlib. 2014-10-31 16:20:02 +11:00
Sebastian Huber
3e1bf786bd ppp: PR1943: Avoid NULL pointer access
Waiting for mbufs at this level is a bad solution.  It would be better
to try to allocate a new mbuf chain before we hand over the current mbuf
chain to the upper layer.  In case the allocation fails we should drop
the current packet and use its mbuf chain for a new packet.
2014-10-08 11:55:15 +02:00
Sebastian Huber
044cf4d713 ppp: Add ppp_unit()
This makes porting to the new network stack easier.
2014-10-08 08:12:24 +02:00
Sebastian Huber
77dd9a4f8a ppp: Nothing to transmit hint for Termios driver 2014-10-07 16:35:20 +02:00
Sebastian Huber
7fd5e89c96 termios: Partially hide rtems_termios_tty
Move interrupt lock to device context and expose only this structure to
the read, write and set attributes device handler.  This makes these
device handler independent of the general Termios infrastructure
suitable for direct use in printk() support.
2014-10-07 16:35:13 +02:00
Sebastian Huber
805360b8e5 pppd: Fix warnings 2014-09-30 14:06:09 +02:00
Sebastian Huber
33739be8af libnetworking: Update due to Termios changes 2014-09-30 14:06:09 +02:00
Joel Sherrill
57871880b2 Add configuration to detect toolset has sigaltstack() prototype 2014-08-20 18:47:02 -05:00
Chris Johns
c49985691f Change all references of rtems.com to rtems.org. 2014-03-21 08:10:47 +11:00
Sebastian Huber
a418b2f8b0 libnetworking: Typo 2014-03-06 09:43:58 +01:00
Nick Withers
a32f996b60 Don't use unsafe buffer operations
Don't use unsafe buffer operations, averting (stack) buffer overflow
when the syslog message length (including Facility and Level encoding)
would exceed 199 characters
2014-01-20 08:52:21 +01:00
Jim Panetta
2b03a62441 NTP: Sync time correctly when receiving broadcast updates
1) The value of rtems_bsdnet_ntpserver_count is equal to 0 when no
   server is set, so the check for (rtems_bsdnet_ntpserver_count < 0)
   in rtems_bsdnet_get_ntp() is wrong.  The check should be "<= 0".

2) Binding the listening socket port to 0 does not work.  Packets
   appear on the interface, but the recvfrom in tryServer() never
   returns.  Changing this to the well known NTP socket 123 allows
   the packets to be seen.

3) In tryServer(), an explicit check for NTP version 3 packets is made.
   If the NTP server is version 4, this check fails even though the
   packets seem to be the right shape.
2014-01-09 09:56:03 -05:00
Sebastian Huber
56bea4339f Filesystem: Use default kqfilter and poll handler 2013-12-20 10:31:53 +01:00
Sebastian Huber
2f68778f08 Filesystem: Add readv/writev handlers
The readv() and writev() support was implemented in terms of multiple
calls to the read and write handlers.  This imposes a problem on device
files which use an IO vector as single request entity.  For example a
low-level network device (e.g. BPF(4)) may use an IO vector to create
one frame from multiple protocol layers each with its own IO vector
entry.
2013-12-20 10:31:53 +01:00
Chris Johns
663ffd0e7c PR2161: Set the source port to SYSLOG in the syslog socket. 2013-12-10 12:37:05 +11:00
Daniel Ramirez
14876018c3 select.h, rtems_select.c, nds select: Add restrict keyword 2013-11-20 18:24:48 -06:00
Sebastian Huber
ae75429ca1 PR766: Delete __RTEMS_VIOLATE_KERNEL_VISIBILITY__ 2013-08-08 14:11:22 +02:00
Sebastian Huber
88c74ab115 score: Merge tod implementation into one file
Delete TOD_MICROSECONDS_PER_SECOND, TOD_MICROSECONDS_TO_TICKS() and
TOD_MILLISECONDS_TO_TICKS().
2013-07-26 11:55:47 +02:00
Sebastian Huber
f6f494373c network: SMP support for network semaphore 2013-07-22 17:27:39 +02:00
Sebastian Huber
ca1d84efb8 network: Include missing header file 2013-07-22 16:45:58 +02:00
Sebastian Huber
95e09afa92 score: Avoid direct usage of _Thread_Executing
Pass the executing thread as a function parameter.  Obtain the executing
thread inside a thread dispatch critical section to avoid problems on
SMP.
2013-07-18 09:58:58 +02:00
Sebastian Huber
20e239c2f0 score: Create mutex implementation header
Move implementation specific parts of coremutex.h and coremutex.inl into
new header file coremuteximpl.h.  The coremutex.h contains now only the
application visible API.
2013-07-18 09:58:57 +02:00
Sebastian Huber
2bbea657ae rtems: Create semaphore implementation header
Move implementation specific parts of sem.h and sem.inl into new header
file semimpl.h.  The sem.h contains now only the application visible
API.
2013-07-18 09:58:56 +02:00
Joel Sherrill
6520aef1e3 sparc in_cksum: Use __sparc__ which is available in -ansi mode 2013-06-20 10:52:48 -05:00
Jiri Gaisler
1f4ee306d3 Added in_cksum_sparc.h to optimize IP checksum calculations for SPARC. 2013-06-19 08:21:40 -05:00
Jeffrey O. Hill
d8e44ecaf8 nios2: Add optimized IP checksum support 2013-03-11 17:57:41 +01:00
Sebastian Huber
b63c8f9b50 ftpfs: Fix SIZE command handling
It is invalid to issue a SIZE command once a data transfer is
in progress.  For reads we issue the SIZE command before the RETR
command and get a snapshot of the file size.  For writes the file size
is initialized to zero and incremented for each write chunk.
2013-01-28 16:46:02 +01:00