From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Gc5e9-0005H7-Rk for qemu-devel@nongnu.org; Mon, 23 Oct 2006 15:39:41 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Gc5e7-0005BN-9z for qemu-devel@nongnu.org; Mon, 23 Oct 2006 15:39:40 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Gc5e7-0005B4-3B for qemu-devel@nongnu.org; Mon, 23 Oct 2006 15:39:39 -0400 Received: from [216.99.193.136] (helo=jade.aracnet.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.52) id 1Gc5e6-0002IW-Ud for qemu-devel@nongnu.org; Mon, 23 Oct 2006 15:39:39 -0400 Received: from mail.elsasser.org (jade.elsasser.org [216.99.208.138]) (authenticated bits=0) by jade.aracnet.com (8.13.6/8.12.8) with ESMTP id k9NJdabr004670 for ; Mon, 23 Oct 2006 12:39:37 -0700 Date: Mon, 23 Oct 2006 12:39:36 -0700 From: Josh Elsasser Message-ID: <20061023193936.GH43740@jade.elsasser.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="45wMVEkw4XUbiYON" 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 --45wMVEkw4XUbiYON Content-Type: multipart/mixed; boundary="I/5syFLg1Ed7r+1G" Content-Disposition: inline --I/5syFLg1Ed7r+1G 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 --I/5syFLg1Ed7r+1G 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; --I/5syFLg1Ed7r+1G-- --45wMVEkw4XUbiYON Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFPRp4z9XqP7gz/VARAlvwAKDnJbsTt0eWIUsll9Dqw5zGDAmURgCglZYC iWRl4j611TrMbhapsghskaY= =Ltg3 -----END PGP SIGNATURE----- --45wMVEkw4XUbiYON--