Author: bz
Date: Wed Mar  4 16:20:59 2020
New Revision: 358620
URL: https://svnweb.freebsd.org/changeset/base/358620

Log:
  Add new ICMPv6 counters for Anti-DoS limits.
  
  Add four new counters for ND6 related Anti-DoS measures.
  We split these out into a separate upfront commit so that we only
  change the struct size one time.  Implementations using them will
  follow.
  
  PR:           157410
  Reviewed by:  melifaro
  MFC after:    2 weeks
  X-MFC:                cannot really MFC this without breaking netstat
  Sponsored by: Netflix (initially)
  Differential Revision:        https://reviews.freebsd.org/D22711

Modified:
  head/sys/netinet/icmp6.h
  head/usr.bin/netstat/inet6.c

Modified: head/sys/netinet/icmp6.h
==============================================================================
--- head/sys/netinet/icmp6.h    Wed Mar  4 14:56:32 2020        (r358619)
+++ head/sys/netinet/icmp6.h    Wed Mar  4 16:20:59 2020        (r358620)
@@ -635,6 +635,10 @@ struct icmp6stat {
        uint64_t icp6s_badrs;           /* bad router solicitation */
        uint64_t icp6s_badra;           /* bad router advertisement */
        uint64_t icp6s_badredirect;     /* bad redirect message */
+       uint64_t icp6s_overflowdefrtr;  /* Too many default routers. */
+       uint64_t icp6s_overflowprfx;    /* Too many prefixes. */
+       uint64_t icp6s_overflownndp;    /* Too many neighbour entries. */
+       uint64_t icp6s_overflowredirect;/* Too many redirects. */
 };
 
 #ifdef _KERNEL

Modified: head/usr.bin/netstat/inet6.c
==============================================================================
--- head/usr.bin/netstat/inet6.c        Wed Mar  4 14:56:32 2020        
(r358619)
+++ head/usr.bin/netstat/inet6.c        Wed Mar  4 16:20:59 2020        
(r358620)
@@ -1055,6 +1055,14 @@ icmp6_stats(u_long off, const char *name, int af1 __un
            "{N:/bad router advertisement message%s}\n");
        p(icp6s_badredirect, "\t{:bad-redirect/%ju} "
            "{N:/bad redirect message%s}\n");
+       p(icp6s_overflowdefrtr, "\t{:default-routers-overflows/%ju} "
+           "{N:/default routers overflow%s}\n");
+       p(icp6s_overflowprfx, "\t{:prefixes-overflows/%ju} "
+           "{N:/prefix overflow%s}\n");
+       p(icp6s_overflownndp, "\t{:neighbour-entries-overflows/%ju} "
+           "{N:/neighbour entries overflow%s}\n");
+       p(icp6s_overflowredirect, "\t{:redirect-overflows/%ju} "
+           "{N:/redirect overflow%s}\n");
        xo_close_container("errors");
        p(icp6s_pmtuchg, "\t{:path-mtu-changes/%ju} {N:/path MTU change%s}\n");
 #undef p
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to