Skip to content

EthernetUDP in Multicast - packet are sent to EthernetUDP source port instead of the destination port #271

Open
@NeyVian

Description

@NeyVian

How to reproduce the issue :

EthernetUDP mcast_udp;
IPAddress mcast_group(230, 1, 1, 1);
uint16_t recv_port = 49500;
uint16_t dest_port = 49600;
mcast_udp.beginMulticast(mcast_group, recv_port);
mcast_udp.beginPacket(mcast_group, dest_port);
mcast_udp.write("some data");
mcast_udp.endPacket();

with this code the packet is sent from recv_port to recv_port, and not to dest_port.

This can be fixed in
socket.cpp > bool EthernetClass::socketSendUDP(uint8_t s)
by replacing
W5100.execCmdSn(s, Sock_SEND);
with
W5100.execCmdSn(s, ((W5100.readSnMR(s) & SnMR::MULTI) == SnMR::MULTI) ? Sock_SEND_MAC : Sock_SEND);

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions