Skip to content

Commit

Permalink
net: qrtr: Allow forwarded services
Browse files Browse the repository at this point in the history
A remote endpoint (immediate neighbors node) can forward services
from other nodes (non-immadiate), in that case ctrl packet node ID
(offering distant service) can differ from the qrtr source node
(forwarding the packet).

Signed-off-by: Loic Poulain <[email protected]>
Reviewed-by: Bjorn Andersson <[email protected]>
Reviewed-by: Manivannan Sadhasivam <[email protected]>
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
Loic Poulain authored and kuba-moo committed Nov 11, 2020
1 parent ae068f5 commit 87f547c
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions net/qrtr/ns.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,10 +517,6 @@ static int ctrl_cmd_new_server(struct sockaddr_qrtr *from,
port = from->sq_port;
}

/* Don't accept spoofed messages */
if (from->sq_node != node_id)
return -EINVAL;

srv = server_add(service, instance, node_id, port);
if (!srv)
return -EINVAL;
Expand Down Expand Up @@ -559,10 +555,6 @@ static int ctrl_cmd_del_server(struct sockaddr_qrtr *from,
port = from->sq_port;
}

/* Don't accept spoofed messages */
if (from->sq_node != node_id)
return -EINVAL;

/* Local servers may only unregister themselves */
if (from->sq_node == qrtr_ns.local_node && from->sq_port != port)
return -EINVAL;
Expand Down

0 comments on commit 87f547c

Please sign in to comment.