cell.c 451 B

1234567891011121314151617181920212223
  1. #include "or.h"
  2. int check_sane_cell(cell_t *cell) {
  3. if(!cell)
  4. return -1;
  5. if(cell->aci == 0) {
  6. log(LOG_DEBUG,"check_sane_cell(): Cell has aci=0. Dropping.");
  7. return -1;
  8. }
  9. #if 0 /* actually, the length is sometimes encrypted. so it's ok. */
  10. if(cell->length > 120) {
  11. log(LOG_DEBUG,"check_sane_cell(): Cell claims to have payload length %d. Dropping.",cell->length);
  12. return -1;
  13. }
  14. #endif
  15. return 0; /* looks good */
  16. }