ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/gvpe/src/vpn_dns.C
(Generate patch)

Comparing gvpe/src/vpn_dns.C (file contents):
Revision 1.53 by root, Tue Oct 18 10:54:17 2011 UTC vs.
Revision 1.54 by root, Tue Oct 18 11:07:28 2011 UTC

397 return true; 397 return true;
398} 398}
399 399
400vpn_packet *byte_stream::get () 400vpn_packet *byte_stream::get ()
401{ 401{
402 if (fill < 2)
403 return 0;
404
402 unsigned int len; 405 unsigned int len;
403 406
404 for (;;) 407 for (;;)
405 { 408 {
406 len = (data [0] << 8) | data [1]; 409 len = (data [0] << 8) | data [1];
407 410
408 if (len <= MAXSIZE || fill < 2) 411 if (len <= MAXSIZE)
409 break; 412 break;
410 413
411 // TODO: handle this better than skipping, e.g. by reset 414 // TODO: handle this better than skipping, e.g. by reset
412 slog (L_DEBUG, _("DNS: corrupted packet stream skipping a byte...")); 415 slog (L_DEBUG, _("DNS: corrupted packet (%02x %02x) stream skipping a byte..."), data [0], data [1]);
413 remove (1); 416 remove (1);
414 } 417 }
415 418
416 if (fill < len + 2) 419 if (fill < len + 2)
417 return 0; 420 return 0;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines