use vc_get_nb_ipv4root() instead of hardcoded '16' value
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 16 Mar 2004 14:30:10 +0000 (14:30 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Tue, 16 Mar 2004 14:30:10 +0000 (14:30 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@1284 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/src/chbind.c

index 6c626df..285fe1c 100644 (file)
@@ -239,10 +239,11 @@ readBcast(char const *str, uint32_t *bcast)
 
 int main (int argc, char *argv[])
 {
-  bool                         is_silent = false;
-  struct vc_ip_mask_pair       ips[16];
+  size_t const                 nb_ipv4root = vc_get_nb_ipv4root();
+  bool                         is_silent   = false;
+  struct vc_ip_mask_pair       ips[nb_ipv4root];
   size_t                       nbaddrs = 0;
-  uint32_t                     bcast = 0xffffffff;
+  uint32_t                     bcast   = 0xffffffff;
   
   while (1) {
     int                c = getopt_long(argc, argv, "+", CMDLINE_OPTIONS, 0);
@@ -254,7 +255,7 @@ int main (int argc, char *argv[])
       case CMD_SILENT          :  is_silent = true; break;
       case CMD_BCAST           :  readBcast(optarg, &bcast); break;
       case CMD_IP              :
-       if (nbaddrs>=16) {
+       if (nbaddrs>=nb_ipv4root) {
          WRITE_MSG(2, "Too many IP numbers, max 16\n");
          exit(wrapper_exit_code);
        }