]> git.sur5r.net Git - bacula/bacula/commitdiff
Remove vestiges of crc32_bad -- fixes Solaris build
authorKern Sibbald <kern@sibbald.com>
Wed, 7 Jun 2017 08:37:36 +0000 (10:37 +0200)
committerKern Sibbald <kern@sibbald.com>
Wed, 7 Jun 2017 08:37:36 +0000 (10:37 +0200)
bacula/src/lib/protos.h
bacula/src/stored/block_util.c
bacula/src/stored/dev.h

index cbad42ddc85b2d58d0a81acb9857d507b60bbede..f76d790f455f600c6b5cd7d110ca5be9fe81fcff 100644 (file)
@@ -154,7 +154,6 @@ void hmac_md5(uint8_t* text, int text_len, uint8_t* key, int key_len, uint8_t *h
 /* crc32.c */
 
 uint32_t bcrc32(unsigned char *buf, int len);
 /* crc32.c */
 
 uint32_t bcrc32(unsigned char *buf, int len);
-uint32_t bcrc32_bad(unsigned char *buf, int len);
 
 
 /* crypto.c */
 
 
 /* crypto.c */
index 5ca251ad09e03cb0fa259eb030457ef89ff3aa54..e18605345f5974d905ed61d59e5636835000766c 100644 (file)
@@ -234,36 +234,6 @@ void print_block_read_errors(JCR *jcr, DEV_BLOCK *block)
    }
 }
 
    }
 }
 
-/* We had a problem on some solaris platforms with the CRC32 library, some
- * 8.4.x jobs uses a bad crc32 algorithm. We just try one then the
- * other to not create false problems
- */
-uint32_t DCR::crc32(unsigned char *buf, int len, uint32_t expected_crc)
-{
-#if defined(HAVE_SUN_OS) && defined(HAVE_LITTLE_ENDIAN)
-   uint32_t crc = 0;
-   if (crc32_type) {
-      crc = bcrc32_bad(buf, len);
-
-   } else {
-      crc = bcrc32(buf, len);
-   }
-   if (expected_crc != crc) {
-      crc32_type = !crc32_type; /* Next time, do it well right away */
-
-      if (crc32_type) {
-         crc = bcrc32_bad(buf, len);
-
-      } else {
-         crc = bcrc32(buf, len);
-      }
-   }
-   return crc;
-#else
-   return bcrc32(buf, len);
-#endif
-}
-
 void DEVICE::free_dcr_blocks(DCR *dcr)
 {
    if (dcr->block == dcr->ameta_block) {
 void DEVICE::free_dcr_blocks(DCR *dcr)
 {
    if (dcr->block == dcr->ameta_block) {
@@ -385,7 +355,7 @@ bool unser_block_header(DCR *dcr, DEVICE *dev, DEV_BLOCK *block)
    if (block->adata) {
       /* Checksum the whole block */
       if (block->block_len <= block->read_len && dev->do_checksum()) {
    if (block->adata) {
       /* Checksum the whole block */
       if (block->block_len <= block->read_len && dev->do_checksum()) {
-         BlockCheckSum = dcr->crc32((uint8_t *)block->buf, block->block_len, block->CheckSum);
+         BlockCheckSum = bcrc32((uint8_t *)block->buf, block->block_len);
          if (BlockCheckSum != block->CheckSum) {
             dev->dev_errno = EIO;
             Mmsg5(dev->errmsg, _("Volume data error at %lld!\n"
          if (BlockCheckSum != block->CheckSum) {
             dev->dev_errno = EIO;
             Mmsg5(dev->errmsg, _("Volume data error at %lld!\n"
@@ -489,9 +459,8 @@ bool unser_block_header(DCR *dcr, DEVICE *dev, DEV_BLOCK *block)
    Dmsg3(390, "Read binbuf = %d %d block_len=%d\n", block->binbuf,
       bhl, block_len);
    if (block_len <= block->read_len && dev->do_checksum()) {
    Dmsg3(390, "Read binbuf = %d %d block_len=%d\n", block->binbuf,
       bhl, block_len);
    if (block_len <= block->read_len && dev->do_checksum()) {
-      BlockCheckSum = dcr->crc32((uint8_t *)block->buf+BLKHDR_CS_LENGTH,
-                                 block_len-BLKHDR_CS_LENGTH,
-                                 block->CheckSum);
+      BlockCheckSum = bcrc32((uint8_t *)block->buf+BLKHDR_CS_LENGTH,
+                                 block_len-BLKHDR_CS_LENGTH);
 
       if (BlockCheckSum != block->CheckSum) {
          dev->dev_errno = EIO;
 
       if (BlockCheckSum != block->CheckSum) {
          dev->dev_errno = EIO;
index 5ead2a508c10ccd0a6ca38f4f2c3e480c058c936..918d88023eb4aff977928d426a99d13038f30717 100644 (file)
@@ -732,7 +732,6 @@ public:
    int Copy;                          /* identical copy number */
    int Stripe;                        /* RAIT stripe */
    VOLUME_CAT_INFO VolCatInfo;        /* Catalog info for desired volume */
    int Copy;                          /* identical copy number */
    int Stripe;                        /* RAIT stripe */
    VOLUME_CAT_INFO VolCatInfo;        /* Catalog info for desired volume */
-   uint32_t crc32(unsigned char *buf, int len, uint32_t expected_crc);
 
    /* Methods */
    void set_no_mount_request() { no_mount_request = true; }; /* Just fail in case of mount request */
 
    /* Methods */
    void set_no_mount_request() { no_mount_request = true; }; /* Just fail in case of mount request */