udp: set the destination port unconditionally.
Even if the caller provides the destination address, still the port must depend on the passed 'event' value for correct delivery. Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
0135e5344d
commit
8d1b30d91c
4
udp.c
4
udp.c
|
@ -218,12 +218,12 @@ static int udp_send(struct transport *t, struct fdarray *fda, int event,
|
|||
addr_buf.sin.sin_family = AF_INET;
|
||||
addr_buf.sin.sin_addr = peer ? mcast_addr[MC_PDELAY] :
|
||||
mcast_addr[MC_PRIMARY];
|
||||
addr_buf.sin.sin_port = htons(event ? EVENT_PORT :
|
||||
GENERAL_PORT);
|
||||
addr_buf.len = sizeof(addr_buf.sin);
|
||||
addr = &addr_buf;
|
||||
}
|
||||
|
||||
addr->sin.sin_port = htons(event ? EVENT_PORT : GENERAL_PORT);
|
||||
|
||||
/*
|
||||
* Extend the payload by two, for UDP checksum correction.
|
||||
* This is not really part of the standard, but it is the way
|
||||
|
|
Loading…
Reference in New Issue