summaryrefslogtreecommitdiff
path: root/slirp/udp6.c
diff options
context:
space:
mode:
Diffstat (limited to 'slirp/udp6.c')
-rw-r--r--slirp/udp6.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/slirp/udp6.c b/slirp/udp6.c
index a23026f2e4..9fa314bc2d 100644
--- a/slirp/udp6.c
+++ b/slirp/udp6.c
@@ -6,8 +6,8 @@
#include "qemu/osdep.h"
#include "qemu-common.h"
#include "slirp.h"
-#include "qemu/osdep.h"
#include "udp.h"
+#include "dhcpv6.h"
void udp6_input(struct mbuf *m)
{
@@ -62,7 +62,17 @@ void udp6_input(struct mbuf *m)
lhost.sin6_addr = ip->ip_src;
lhost.sin6_port = uh->uh_sport;
- /* TODO handle DHCP/BOOTP */
+ /* handle DHCPv6 */
+ if (ntohs(uh->uh_dport) == DHCPV6_SERVER_PORT &&
+ (in6_equal(&ip->ip_dst, &slirp->vhost_addr6) ||
+ in6_equal(&ip->ip_dst, &(struct in6_addr)ALLDHCP_MULTICAST))) {
+ m->m_data += iphlen;
+ m->m_len -= iphlen;
+ dhcpv6_input(&lhost, m);
+ m->m_data -= iphlen;
+ m->m_len += iphlen;
+ goto bad;
+ }
/* handle TFTP */
if (ntohs(uh->uh_dport) == TFTP_SERVER &&