~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to slirp/ip_icmp.c

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-22 10:13:17 UTC
  • mfrom: (1.2.1 upstream) (6.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090322101317-iigjtnu5qil35dtb
Tags: 0.10.1-1
[ Aurelien Jarno ]
* New upstream stable release:
  - patches/80_stable-branch.patch: remove.
* debian/control: 
  - Remove depends on proll.
  - Move depends on device-tree-compiler to build-depends.
  - Bump Standards-Version to 3.8.1 (no changes).
* patches/82_qemu-img_decimal.patch: new patch from upstream to make
  qemu-img accept sizes with decimal values (closes: bug#501400).

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
11
 *    notice, this list of conditions and the following disclaimer in the
12
12
 *    documentation and/or other materials provided with the distribution.
13
 
 * 3. All advertising materials mentioning features or use of this software
14
 
 *    must display the following acknowledgement:
15
 
 *      This product includes software developed by the University of
16
 
 *      California, Berkeley and its contributors.
17
 
 * 4. Neither the name of the University nor the names of its contributors
 
13
 * 3. Neither the name of the University nor the names of its contributors
18
14
 *    may be used to endorse or promote products derived from this software
19
15
 *    without specific prior written permission.
20
16
 *
43
39
 
44
40
/* The message sent when emulating PING */
45
41
/* Be nice and tell them it's just a pseudo-ping packet */
46
 
const char icmp_ping_msg[] = "This is a pseudo-PING packet used by Slirp to emulate ICMP ECHO-REQUEST packets.\n";
 
42
static const char icmp_ping_msg[] = "This is a pseudo-PING packet used by Slirp to emulate ICMP ECHO-REQUEST packets.\n";
47
43
 
48
44
/* list of actions for icmp_error() on RX of an icmp message */
49
45
static const int icmp_flush[19] = {
207
203
 
208
204
#define ICMP_MAXDATALEN (IP_MSS-28)
209
205
void
210
 
icmp_error(msrc, type, code, minsize, message)
211
 
     struct mbuf *msrc;
212
 
     u_char type;
213
 
     u_char code;
214
 
     int minsize;
215
 
     char *message;
 
206
icmp_error(struct mbuf *msrc, u_char type, u_char code, int minsize,
 
207
           const char *message)
216
208
{
217
209
  unsigned hlen, shlen, s_ip_len;
218
210
  register struct ip *ip;
228
220
  /* check msrc */
229
221
  if(!msrc) goto end_error;
230
222
  ip = mtod(msrc, struct ip *);
231
 
#if DEBUG
 
223
#ifdef DEBUG
232
224
  { char bufa[20], bufb[20];
233
225
    strcpy(bufa, inet_ntoa(ip->ip_src));
234
226
    strcpy(bufb, inet_ntoa(ip->ip_dst));
285
277
  HTONS(icp->icmp_ip.ip_id);
286
278
  HTONS(icp->icmp_ip.ip_off);
287
279
 
288
 
#if DEBUG
 
280
#ifdef DEBUG
289
281
  if(message) {           /* DEBUG : append message to ICMP packet */
290
282
    int message_len;
291
283
    char *cpnt;