From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GcTmR-00029F-CB for qemu-devel@nongnu.org; Tue, 24 Oct 2006 17:25:51 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GcTmO-00027l-Jo for qemu-devel@nongnu.org; Tue, 24 Oct 2006 17:25:50 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GcTmO-00027i-ID for qemu-devel@nongnu.org; Tue, 24 Oct 2006 17:25:48 -0400 Received: from [216.99.193.130] (helo=ruby.spiritone.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1GcTmO-0008Vf-CA for qemu-devel@nongnu.org; Tue, 24 Oct 2006 17:25:48 -0400 Received: from mail.elsasser.org (jade.elsasser.org [216.99.208.138]) (authenticated bits=0) by ruby.spiritone.com (8.13.6/8.13.4) with ESMTP id k9OLPk5f011258 for ; Tue, 24 Oct 2006 14:25:46 -0700 Date: Tue, 24 Oct 2006 14:25:45 -0700 From: Josh Elsasser Message-ID: <20061024212545.GB79722@jade.elsasser.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+B+y8wtTXqdUj1xM" Content-Disposition: inline Subject: [Qemu-devel] [patch] slirp dhcp broadcast flag support Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --+B+y8wtTXqdUj1xM Content-Type: multipart/mixed; boundary="/e2eDi0V/xtL+Mc8" Content-Disposition: inline --/e2eDi0V/xtL+Mc8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline This patch adds support for the dhcp broadcast flag to slirp's dhcp server. If a DHCP DISCOVER/REQUEST packet is recieved with the broadcast flag set then the response will be sent to 255.255.255.255. -jre --/e2eDi0V/xtL+Mc8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dhcp.diff" Content-Transfer-Encoding: quoted-printable Index: slirp/bootp.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/qemu/qemu/slirp/bootp.c,v retrieving revision 1.8 diff -u -r1.8 bootp.c --- slirp/bootp.c 16 Apr 2006 11:06:58 -0000 1.8 +++ slirp/bootp.c 21 Oct 2006 02:29:36 -0000 @@ -184,6 +184,12 @@ rbp->bp_yiaddr =3D daddr.sin_addr; /* Client IP address */ rbp->bp_siaddr =3D saddr.sin_addr; /* Server IP address */ =20 + if (ntohs(bp->bp_flags) & RFC1531_BROADCAST_FLAG) { + rbp->bp_flags =3D htons(RFC1531_BROADCAST_FLAG); + daddr.sin_addr.s_addr =3D 0xffffffff; + /* XXX should use link-level address to ff:ff:ff:ff:ff:ff too */ + } + q =3D rbp->bp_vend; memcpy(q, rfc1533_cookie, 4); q +=3D 4; Index: slirp/bootp.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/qemu/qemu/slirp/bootp.h,v retrieving revision 1.2 diff -u -r1.2 bootp.h --- slirp/bootp.h 5 Jun 2005 17:11:42 -0000 1.2 +++ slirp/bootp.h 21 Oct 2006 02:29:36 -0000 @@ -6,6 +6,8 @@ #define BOOTP_REQUEST 1 #define BOOTP_REPLY 2 =20 +#define RFC1531_BROADCAST_FLAG 0x8000 + #define RFC1533_COOKIE 99, 130, 83, 99 #define RFC1533_PAD 0 #define RFC1533_NETMASK 1 @@ -99,7 +101,7 @@ uint8_t bp_hops; uint32_t bp_xid; uint16_t bp_secs; - uint16_t unused; + uint16_t bp_flags; struct in_addr bp_ciaddr; struct in_addr bp_yiaddr; struct in_addr bp_siaddr; --/e2eDi0V/xtL+Mc8-- --+B+y8wtTXqdUj1xM Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFPoTZz9XqP7gz/VARAudYAKCVGXEYLsZN5GwrQN88JaqeVz2rSQCgkZhY /N/RvZJ56QsoTWo6E3JsOjo= =n+GP -----END PGP SIGNATURE----- --+B+y8wtTXqdUj1xM--