The code for setting multicast ttl (LuaSocket 2.02 and earlier) is :
int opt_ip_multicast_ttl(lua_State *L, p_socket ps)
{
int val = (int) luaL_checknumber(L, 3); /* obj, name, int */
return opt_set(L, ps, SOL_SOCKET, SO_LINGER, (char *) &val, sizeof(val));
}
where I expected something like :
int opt_ip_multicast_ttl(lua_State *L, p_socket ps)
{
int val = (int) luaL_checknumber(L, 3); /* obj, name, int */
return opt_set(L, ps, IPPROTO_IP, IP_MULTICAST_TTL, (char *) &val,
sizeof(val));
}
Also, can we have the option to set the outbound multicast interface ? The
call to be implemented is a wrapper for :
setsockopt(s, IPPROTO_IP, IP_MULTICAST_IF, &addr, sizeof(addr));