Browse Source

[pxe] Add extra debug messages to the PXE UDP API calls

tags/v0.9.4
Michael Brown 16 years ago
parent
commit
0ffc3f6285
1 changed files with 16 additions and 4 deletions
  1. 16
    4
      src/interface/pxe/pxe_udp.c

+ 16
- 4
src/interface/pxe/pxe_udp.c View File

166
 
166
 
167
 	/* Record source IP address */
167
 	/* Record source IP address */
168
 	pxe_udp.local.sin_addr.s_addr = pxenv_udp_open->src_ip;
168
 	pxe_udp.local.sin_addr.s_addr = pxenv_udp_open->src_ip;
169
+	DBG ( " %s", inet_ntoa ( pxe_udp.local.sin_addr ) );
169
 
170
 
170
 	/* Open promiscuous UDP connection */
171
 	/* Open promiscuous UDP connection */
171
 	xfer_close ( &pxe_udp.xfer, 0 );
172
 	xfer_close ( &pxe_udp.xfer, 0 );
355
  *
356
  *
356
  */
357
  */
357
 PXENV_EXIT_t pxenv_udp_read ( struct s_PXENV_UDP_READ *pxenv_udp_read ) {
358
 PXENV_EXIT_t pxenv_udp_read ( struct s_PXENV_UDP_READ *pxenv_udp_read ) {
358
-	struct in_addr dest_ip = { .s_addr = pxenv_udp_read->dest_ip };
359
-	uint16_t d_port = pxenv_udp_read->d_port;
359
+	struct in_addr dest_ip_wanted = { .s_addr = pxenv_udp_read->dest_ip };
360
+	struct in_addr dest_ip;
361
+	uint16_t d_port_wanted = pxenv_udp_read->d_port;
362
+	uint16_t d_port;
360
 
363
 
361
 	DBG ( "PXENV_UDP_READ" );
364
 	DBG ( "PXENV_UDP_READ" );
362
 
365
 
368
 		pxe_udp.pxenv_udp_read = NULL;
371
 		pxe_udp.pxenv_udp_read = NULL;
369
 		goto no_packet;
372
 		goto no_packet;
370
 	}
373
 	}
374
+	dest_ip.s_addr = pxenv_udp_read->dest_ip;
375
+	d_port = pxenv_udp_read->d_port;
371
 
376
 
372
 	/* Filter on destination address and/or port */
377
 	/* Filter on destination address and/or port */
373
-	if ( dest_ip.s_addr && ( dest_ip.s_addr != pxenv_udp_read->dest_ip ) )
378
+	if ( dest_ip_wanted.s_addr &&
379
+	     ( dest_ip_wanted.s_addr != dest_ip.s_addr ) ) {
380
+		DBG ( " wrong IP %s", inet_ntoa ( dest_ip ) );
381
+		DBG ( " (wanted %s)", inet_ntoa ( dest_ip_wanted ) );
374
 		goto no_packet;
382
 		goto no_packet;
375
-	if ( d_port && ( d_port != pxenv_udp_read->d_port ) )
383
+	}
384
+	if ( d_port_wanted && ( d_port_wanted != d_port ) ) {
385
+		DBG ( " wrong port %d ", htons ( d_port ) );
386
+		DBG ( " (wanted %d)", htons ( d_port_wanted ) );
376
 		goto no_packet;
387
 		goto no_packet;
388
+	}
377
 
389
 
378
 	DBG ( " %04x:%04x+%x %s:", pxenv_udp_read->buffer.segment,
390
 	DBG ( " %04x:%04x+%x %s:", pxenv_udp_read->buffer.segment,
379
 	      pxenv_udp_read->buffer.offset, pxenv_udp_read->buffer_size,
391
 	      pxenv_udp_read->buffer.offset, pxenv_udp_read->buffer_size,

Loading…
Cancel
Save