From 3279ea09f4cbfb29a4027164ee0ca6ea6c2b7827 Mon Sep 17 00:00:00 2001 From: Tomas 'ZeXx86' Jedrzejek Date: Mon, 22 Jun 2009 19:02:49 +0200 Subject: [PATCH] Fixed source IP address in UDP implementation - was specified by ip address from interface, not from connection structure --- kernel/core/net/udp.c | 2 +- kernel/core/net/udp6.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/core/net/udp.c b/kernel/core/net/udp.c index aa5662d..dd9fa3f 100644 --- a/kernel/core/net/udp.c +++ b/kernel/core/net/udp.c @@ -419,7 +419,7 @@ int net_proto_udp_write (proto_udp_conn_t *conn, char *data, unsigned len) ip->ttl = 64; ip->checksum = 0; ip->proto = NET_PROTO_IP_TYPE_UDP; - ip->ip_source = conn->netif->ip; + ip->ip_source = conn->ip_source; ip->ip_dest = conn->ip_dest; diff --git a/kernel/core/net/udp6.c b/kernel/core/net/udp6.c index 36f567b..2baf615 100644 --- a/kernel/core/net/udp6.c +++ b/kernel/core/net/udp6.c @@ -418,7 +418,7 @@ int net_proto_udp6_write (proto_udp6_conn_t *conn, char *data, unsigned len) ip->pl_len = swap16 (len); ip->nhead = NET_PROTO_IP_TYPE_UDP6; ip->hop = 0xff; - memcpy (ip->ip_source, (void *) conn->netif->ipv6, sizeof (net_ipv6)); + memcpy (ip->ip_source, (void *) conn->ip_source, sizeof (net_ipv6)); memcpy (ip->ip_dest, (void *) conn->ip_dest, sizeof (net_ipv6)); -- 2.11.4.GIT