Age | Commit message (Collapse) | Author | Files | Lines |
|
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
realloc/g_realloc() allocates memory if given ptr is NULL.
Note:
This changes a bit the code, since now sb_cc is always reset to 0,
even if old and new value are the same. This seems more coherent, but
may have weird side-effects if code relies on it.
Reviewing usage of sbreserve() reveals that it is used before the
socket buffer receives any data, at tcp_input() socket creation time,
and during tcp_mss() which is earlier in TCP socket state.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Negative values wouldn't make sense in those functions and could lead
to weird results.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
glib mem functions are already used in various places. Let's not mix
the two, and instead abort on OOM conditions.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Let see if it happens, and drop it eventually some day.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
We shouldn't be reading undefined data, check that the data to read
remains within sb_cc limit.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
The only sbcopy() caller is tcp_output(). There, len is constrained to
be 0 <= len <= sb_cc. Let's add some assert to avoid potential
undefined behaviour (the function didn't return the actual number of
bytes copied).
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
Signed-off-by: Jindrich Novy <jnovy@redhat.com>
[ Marc-André - modified to use a temporary variable ]
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
The slirp COPYRIGHT file is a BSD-3 license. Instead of referring to
another project file, the SPDX license notice present in all source
files states that unequivocally.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
|
|
Add SPDX license identifier to clarify the license of files with
reference to BSD license from slirp COPYRIGHT file.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
|
|
Prepare for making slirp/ a standalone project.
Remove some useless includes while at it.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20190212162524.31504-5-marcandre.lureau@redhat.com>
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
|