[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/9] slirp: Strictly associate DHCP/BOOTP and TFTP w
From: |
Jan Kiszka |
Subject: |
[Qemu-devel] [PATCH 3/9] slirp: Strictly associate DHCP/BOOTP and TFTP with virtual host |
Date: |
Tue, 7 Jun 2011 18:45:37 +0200 |
Instead of accepting every DHCP/BOOTP and TFTP packet, only invoke the
built-in servers if the target is the virtual host.
Signed-off-by: Jan Kiszka <address@hidden>
---
slirp/udp.c | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/slirp/udp.c b/slirp/udp.c
index f1a9a10..cefd50b 100644
--- a/slirp/udp.c
+++ b/slirp/udp.c
@@ -120,15 +120,18 @@ udp_input(register struct mbuf *m, int iphlen)
/*
* handle DHCP/BOOTP
*/
- if (ntohs(uh->uh_dport) == BOOTP_SERVER) {
- bootp_input(m);
- goto bad;
- }
+ if (ntohs(uh->uh_dport) == BOOTP_SERVER &&
+ (ip->ip_dst.s_addr == slirp->vhost_addr.s_addr ||
+ ip->ip_dst.s_addr == 0xffffffff)) {
+ bootp_input(m);
+ goto bad;
+ }
/*
* handle TFTP
*/
- if (ntohs(uh->uh_dport) == TFTP_SERVER) {
+ if (ntohs(uh->uh_dport) == TFTP_SERVER &&
+ ip->ip_dst.s_addr == slirp->vhost_addr.s_addr) {
tftp_input(m);
goto bad;
}
--
1.7.1
- Re: [Qemu-devel] [PATCH 6/9] net: Improve layout of 'info network', (continued)
[Qemu-devel] [PATCH 2/9] slirp: Canonicalize restrict syntax, Jan Kiszka, 2011/06/07
[Qemu-devel] [PATCH 4/9] slirp: Replace m_freem with m_free, Jan Kiszka, 2011/06/07
[Qemu-devel] [PATCH 8/9] net: Dump client type 'info network', Jan Kiszka, 2011/06/07
[Qemu-devel] [PATCH 5/9] slirp: Put forked exec into separate process group, Jan Kiszka, 2011/06/07
[Qemu-devel] [PATCH 9/9] net: Consistently use qemu_macaddr_default_if_unset, Jan Kiszka, 2011/06/07
[Qemu-devel] [PATCH 3/9] slirp: Strictly associate DHCP/BOOTP and TFTP with virtual host,
Jan Kiszka <=
[Qemu-devel] [PATCH 7/9] net: Refactor net_client_types, Jan Kiszka, 2011/06/07
Re: [Qemu-devel] [PATCH 0/9] Various net and slirp fixes & enhancements, Markus Armbruster, 2011/06/08