[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [patch #9165] Allowing udp src port to be 0 in cases when w
From: |
Alex Moran |
Subject: |
[lwip-devel] [patch #9165] Allowing udp src port to be 0 in cases when we don't care about outgoing port |
Date: |
Thu, 17 Nov 2016 22:25:38 +0000 (UTC) |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36 |
URL:
<http://savannah.nongnu.org/patch/?9165>
Summary: Allowing udp src port to be 0 in cases when we don't
care about outgoing port
Project: lwIP - A Lightweight TCP/IP stack
Submitted by: alex081293
Submitted on: Thu 17 Nov 2016 10:25:35 PM GMT
Category: UDP
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
Discussion Lock: Any
Planned Release: None
_______________________________________________________
Details:
In the case of knowing the senders IP address, the host running LWIP should be
able to open a socket on their known local port and be able to receive packets
from the known sender without caring about its source port.
With the current implementation of the UDP stack, it is impossible to
receiving a packet from only the intended source without first knowing it's
outgoing port. I believe you should be able to specify if you do not care
about the outgoing port of the sender but only want to receive packets from
that address like so:
udp_bind(this->pcb, IP_ADDR_ANY, LocalPort);
udp_connect(this->pcb, &RecvIPAddress), 0);
The patch I'd like to add is to change line 278 of the current /src/core/udp.c
file to:
((pcb->remote_port == src) || (pcb->remote_port == 0)) &&
Without this change, the packet gets to the udp layer but is dropped. This
allows the packet to be passed up to the application layer regardless of what
the remote port is.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/patch/?9165>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [patch #9165] Allowing udp src port to be 0 in cases when we don't care about outgoing port,
Alex Moran <=