diff options
Diffstat (limited to 'slirp/udp6.c')
-rw-r--r-- | slirp/udp6.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/slirp/udp6.c b/slirp/udp6.c index a9a3671..60a91c9 100644 --- a/slirp/udp6.c +++ b/slirp/udp6.c @@ -57,14 +57,24 @@ void udp6_input(struct mbuf *m) */ save_ip = *ip; - /* TODO handle DHCP/BOOTP */ - /* TODO handle TFTP */ - /* Locate pcb for datagram. */ lhost.sin6_family = AF_INET6; lhost.sin6_addr = ip->ip_src; lhost.sin6_port = uh->uh_sport; + /* TODO handle DHCP/BOOTP */ + + /* handle TFTP */ + if (ntohs(uh->uh_dport) == TFTP_SERVER && + !memcmp(ip->ip_dst.s6_addr, slirp->vhost_addr6.s6_addr, 16)) { + m->m_data += iphlen; + m->m_len -= iphlen; + tftp_input((struct sockaddr_storage *)&lhost, m); + m->m_data -= iphlen; + m->m_len += iphlen; + goto bad; + } + so = solookup(&slirp->udp_last_so, &slirp->udb, (struct sockaddr_storage *) &lhost, NULL); |