olsrd-quagga: Exit if unsupported packet version is selected
authorVasilis Tsiligiannis <b_tsiligiannis@silverton.gr>
Tue, 5 Jun 2012 12:40:07 +0000 (15:40 +0300)
committerVasilis Tsiligiannis <b_tsiligiannis@silverton.gr>
Tue, 5 Jun 2012 12:40:07 +0000 (15:40 +0300)
lib/quagga/src/packet.c
lib/quagga/src/parse.c

index e3d5cbc..3743626 100644 (file)
@@ -48,6 +48,7 @@ unsigned char
       t += sizeof cmd;
       break;
     default:
+      olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
       break;
   }
   *t++ = r->type;
@@ -63,6 +64,7 @@ unsigned char
       t += sizeof safi;
       break;
     default:
+      olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
       break;
   }
   *t++ = r->prefixlen;
@@ -129,6 +131,7 @@ unsigned char
       pnt += sizeof cmd;
       break;
     default:
+      olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
       break;
   }
   *pnt++ = type;
index e70d25c..a311940 100644 (file)
@@ -61,6 +61,7 @@ static struct zroute
       pnt = &opt[6];
       break;
     default:
+      olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
       break;
   }
   r->type = *pnt++;
@@ -104,7 +105,7 @@ static struct zroute
       }
       break;
     default:
-      OLSR_PRINTF(1, "(QUAGGA) Unsupported zebra packet version!\n");
+      olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
       break;
   }
 
@@ -160,6 +161,7 @@ zparse(void *foo __attribute__ ((unused)))
           command = ntohs (command);
           break;
         default:
+          olsr_exit("(QUAGGA) Unsupported zebra packet version!\n", EXIT_FAILURE);
           break;
       }
       if (olsr_cnf->ip_version == AF_INET) {