summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Georg <mail@jensge.org>2022-10-13 23:11:46 +0200
committerJens Georg <mail@jensge.org>2022-10-13 23:11:46 +0200
commitc8a80b1c4d8d0bde625eb22552e39c7571374ea8 (patch)
treeef0c6453dab9821f9f48840fd072f14ae6ee1a5f
parent408e1622cb20d08ff6f5cd5235802ffbc4658817 (diff)
downloadgssdp-c8a80b1c4d8d0bde625eb22552e39c7571374ea8.tar.gz
Revert "client: Do not accept multicast packets on lo"
This reverts commit 7ecb930d93714b34e751d63a1db47028a2bbf7fe.
-rw-r--r--libgssdp/gssdp-client.c26
1 files changed, 8 insertions, 18 deletions
diff --git a/libgssdp/gssdp-client.c b/libgssdp/gssdp-client.c
index a81f81d..60aeb06 100644
--- a/libgssdp/gssdp-client.c
+++ b/libgssdp/gssdp-client.c
@@ -1726,29 +1726,19 @@ socket_source_cb (GSSDPSocketSource *socket_source, GSSDPClient *client)
msg = GSSDP_PKTINFO6_MESSAGE (messages[i]);
msg_ifindex = gssdp_pktinfo6_message_get_ifindex (msg);
local_addr = gssdp_pktinfo6_message_get_local_addr (msg);
- } else {
+ } else
continue;
- }
/* message needs to be on correct interface or on
* loopback (as kernel can be smart and route things
* there even if sent to another network) */
- if (g_inet_address_equal (local_addr, group_addr)) {
- // This is a multicast packet. If the index is not our index, ignore
- if (msg_ifindex != priv->device.index) {
- goto out;
- }
- break;
- }
-
- if (g_inet_address_equal (local_addr,
- priv->device.host_addr)) {
- // This is a "normal" packet. We can receive those
-
- if (msg_ifindex != priv->device.index &&
- msg_ifindex != LOOPBACK_IFINDEX) {
- goto out;
- }
+ if (!((msg_ifindex == priv->device.index ||
+ msg_ifindex == LOOPBACK_IFINDEX) &&
+ (g_inet_address_equal (local_addr,
+ priv->device.host_addr) ||
+ g_inet_address_equal (local_addr, group_addr)))) {
+ goto out;
+ } else {
break;
}
}