Print this page
4787 ipf: remove rate_limit_message

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/ipf/ip_fil_solaris.c
          +++ new/usr/src/uts/common/inet/ipf/ip_fil_solaris.c
↓ open down ↓ 1284 lines elided ↑ open up ↑
1285 1285          return fr_send_ip(fin, m, &m);
1286 1286  }
1287 1287  
1288 1288  #include <sys/time.h>
1289 1289  #include <sys/varargs.h>
1290 1290  
1291 1291  #ifndef _KERNEL
1292 1292  #include <stdio.h>
1293 1293  #endif
1294 1294  
1295      -#define NULLADDR_RATE_LIMIT 10  /* 10 seconds */
1296      -
1297      -
1298      -/*
1299      - * Print out warning message at rate-limited speed.
1300      - */
1301      -static void rate_limit_message(ipf_stack_t *ifs,
1302      -                               int rate, const char *message, ...)
1303      -{
1304      -        static time_t last_time = 0;
1305      -        time_t now;
1306      -        va_list args;
1307      -        char msg_buf[256];
1308      -        int  need_printed = 0;
1309      -
1310      -        now = ddi_get_time();
1311      -
1312      -        /* make sure, no multiple entries */
1313      -        ASSERT(MUTEX_NOT_HELD(&(ifs->ifs_ipf_rw.ipf_lk)));
1314      -        MUTEX_ENTER(&ifs->ifs_ipf_rw);
1315      -        if (now - last_time >= rate) {
1316      -                need_printed = 1;
1317      -                last_time = now;
1318      -        }
1319      -        MUTEX_EXIT(&ifs->ifs_ipf_rw);
1320      -
1321      -        if (need_printed) {
1322      -                va_start(args, message);
1323      -                (void)vsnprintf(msg_buf, 255, message, args);
1324      -                va_end(args);
1325      -#ifdef _KERNEL
1326      -                cmn_err(CE_WARN, msg_buf);
1327      -#else
1328      -                fprintf(std_err, msg_buf);
1329      -#endif
1330      -        }
1331      -}
1332      -
1333 1295  /*
1334 1296   * Return the first IP Address associated with an interface
1335 1297   * For IPv6, we walk through the list of logical interfaces and return
1336 1298   * the address of the first one that isn't a link-local interface.
1337 1299   * We can't assume that it is :1 because another link-local address
1338 1300   * may have been assigned there.
1339 1301   */
1340 1302  /*ARGSUSED*/
1341 1303  int fr_ifpaddr(v, atype, ifptr, inp, inpmask, ifs)
1342 1304  int v, atype;
↓ open down ↓ 1557 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX