MT#55283 add extra null checks

Don't just check for the selected_sfd to be non null, but also for the
socket to actually be open, as this is needed for the translate_ep set
of functions in particular.

Change-Id: I78cb0f7b8c9e4359c9e037485b29f63e0cd9476b
(cherry picked from commit 9cb902319c)
mr26.1
Richard Fuchs 3 weeks ago
parent 080f1b1788
commit 5357717e37

@ -1582,6 +1582,8 @@ static const char *kernelize_target(kernelize_state *s, struct packet_stream *st
s->non_forwarding = true;
stream_fd *sfd = stream->selected_sfd;
if (!sfd || !sfd->socket.family)
return "socket not open";
ilog(LOG_INFO, "Kernelizing media stream: remote %s%s%s -> local %s",
FMT_M(endpoint_print_buf(&stream->endpoint)),
@ -1807,7 +1809,7 @@ static const char *kernelize_one(kernelize_state *s,
__auto_type reti = &s->reti.target;
// any output at all?
if (s->non_forwarding || !sink->selected_sfd)
if (s->non_forwarding || !sink->selected_sfd || !sink->selected_sfd->socket.family)
return NULL; // no output
if (!PS_ISSET(sink, FILLED))
return NULL;
@ -1946,7 +1948,7 @@ static void kernelize(struct packet_stream *stream) {
LOCK(&stream->lock);
if (!stream->selected_sfd)
if (!stream->selected_sfd || !stream->selected_sfd->socket.family)
goto no_kernel;
{
@ -2086,7 +2088,7 @@ void __unkernelize(struct packet_stream *p, const char *reason) {
bool no_supp = PS_CLEAR(p, NO_KERNEL_SUPPORT);
if (!sfd)
if (!sfd || !sfd->socket.family)
return;
if (!sfd->kernelized)
return;

Loading…
Cancel
Save