}
static gboolean
-fill_address (const gchar * address, guint16 port, Addr * addr)
+fill_address (const gchar * address, guint16 port, Addr * addr,
+ gboolean is_multicast)
{
GInetAddress *inet;
if (inet == NULL)
return FALSE;
+ if (is_multicast != g_inet_address_get_is_multicast (inet)) {
+ g_object_unref (inet);
+ return FALSE;
+ }
+
addr->size = g_inet_address_get_native_size (inet);
memcpy (addr->bytes, g_inet_address_to_bytes (inet), addr->size);
g_object_unref (inet);
range = g_slice_new0 (AddrRange);
- if (!fill_address (min_address, min_port, &range->min))
+ if (!fill_address (min_address, min_port, &range->min, (ttl != 0)))
goto invalid;
- if (!fill_address (max_address, max_port, &range->max))
+ if (!fill_address (max_address, max_port, &range->max, (ttl != 0)))
goto invalid;
if (range->min.size != range->max.size)
result = NULL;
addr = NULL;
- if (!fill_address (address, port, &input_addr)) {
+ if (!fill_address (address, port, &input_addr, (ttl != 0))) {
GST_ERROR_OBJECT (pool, "invalid address %s", address);
return NULL;
}
* starting with even port
*/
fail_unless (gst_rtsp_address_pool_add_range (pool,
- "2001:DB8::1", "2001:DB8::1", 5001, 5003, 1));
+ "FF11:DB8::1", "FF11:DB8::1", 5001, 5003, 1));
addr = gst_rtsp_address_pool_acquire_address (pool,
GST_RTSP_ADDRESS_FLAG_IPV6 | GST_RTSP_ADDRESS_FLAG_EVEN_PORT |
GST_RTSP_ADDRESS_FLAG_MULTICAST, 2);
fail_unless (addr != NULL);
fail_unless (addr->port == 5002);
- fail_unless (!g_ascii_strcasecmp (addr->address, "2001:DB8::1"));
+ fail_unless (!g_ascii_strcasecmp (addr->address, "FF11:DB8::1"));
/* Will fail becuse there is only one IPv6 address left */
addr2 = gst_rtsp_address_pool_acquire_address (pool,