summaryrefslogtreecommitdiff
path: root/sys/src/9/ip/udp.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2019-11-10 19:50:46 +0100
committercinap_lenrek <cinap_lenrek@felloff.net>2019-11-10 19:50:46 +0100
commitb638c7753d8498eaec90f06a7c140ffe0ed76cdb (patch)
treee20dbe46127376074017b11119c4b9cd7112fc27 /sys/src/9/ip/udp.c
parentd72a4043993d02b56873dfe40767cef9336685fc (diff)
devip: use the routing table for local source ip address selection
when making outgoing connections, the source ip was selected by just iterating from the first to the last interface and trying each local address until a route was found. the result was kind of hard to predict as it depends on the interface order. this change replaces the algorithm with the route lookup algorithm that we already have which takes more specific desination and source prefixes into account. so the order of interfaces does not matter anymore.
Diffstat (limited to 'sys/src/9/ip/udp.c')
-rw-r--r--sys/src/9/ip/udp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/9/ip/udp.c b/sys/src/9/ip/udp.c
index 6a2e03dcd..86205caec 100644
--- a/sys/src/9/ip/udp.c
+++ b/sys/src/9/ip/udp.c
@@ -423,7 +423,7 @@ udpiput(Proto *udp, Ipifc *ifc, Block *bp)
if(ucb->headers == 0){
/* create a new conversation */
if(ipforme(f, laddr) != Runi)
- ipv6local(ifc, laddr, raddr);
+ ipv6local(ifc, laddr, 0, raddr);
c = Fsnewcall(c, raddr, rport, laddr, lport, version);
if(c == nil){
qunlock(udp);