Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F171459563
D26578.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D26578.diff
View Options
Index: head/sys/netinet/icmp6.h
===================================================================
--- head/sys/netinet/icmp6.h
+++ head/sys/netinet/icmp6.h
@@ -639,6 +639,8 @@
uint64_t icp6s_overflowprfx; /* Too many prefixes. */
uint64_t icp6s_overflownndp; /* Too many neighbour entries. */
uint64_t icp6s_overflowredirect;/* Too many redirects. */
+ uint64_t icp6s_invlhlim; /* Invalid hop limit. */
+ uint64_t icp6s_spare[32];
};
#ifdef _KERNEL
Index: head/sys/netinet6/icmp6.c
===================================================================
--- head/sys/netinet6/icmp6.c
+++ head/sys/netinet6/icmp6.c
@@ -2261,7 +2261,8 @@
ip6_sprintf(ip6buf, &src6)));
goto bad;
}
- if (ip6->ip6_hlim != 255) {
+ if (__predict_false(ip6->ip6_hlim != 255)) {
+ ICMP6STAT_INC(icp6s_invlhlim);
nd6log((LOG_ERR,
"ICMP6 redirect sent from %s rejected; "
"hlim=%d (must be 255)\n",
Index: head/sys/netinet6/nd6_nbr.c
===================================================================
--- head/sys/netinet6/nd6_nbr.c
+++ head/sys/netinet6/nd6_nbr.c
@@ -136,7 +136,8 @@
ifp = m->m_pkthdr.rcvif;
ip6 = mtod(m, struct ip6_hdr *);
- if (ip6->ip6_hlim != 255) {
+ if (__predict_false(ip6->ip6_hlim != 255)) {
+ ICMP6STAT_INC(icp6s_invlhlim);
nd6log((LOG_ERR,
"nd6_ns_input: invalid hlim (%d) from %s to %s on %s\n",
ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src),
@@ -641,7 +642,8 @@
ifp = m->m_pkthdr.rcvif;
ip6 = mtod(m, struct ip6_hdr *);
- if (ip6->ip6_hlim != 255) {
+ if (__predict_false(ip6->ip6_hlim != 255)) {
+ ICMP6STAT_INC(icp6s_invlhlim);
nd6log((LOG_ERR,
"nd6_na_input: invalid hlim (%d) from %s to %s on %s\n",
ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src),
Index: head/sys/netinet6/nd6_rtr.c
===================================================================
--- head/sys/netinet6/nd6_rtr.c
+++ head/sys/netinet6/nd6_rtr.c
@@ -177,7 +177,8 @@
/* Sanity checks */
ip6 = mtod(m, struct ip6_hdr *);
- if (ip6->ip6_hlim != 255) {
+ if (__predict_false(ip6->ip6_hlim != 255)) {
+ ICMP6STAT_INC(icp6s_invlhlim);
nd6log((LOG_ERR,
"%s: invalid hlim (%d) from %s to %s on %s\n", __func__,
ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src),
@@ -376,7 +377,8 @@
goto freeit;
ip6 = mtod(m, struct ip6_hdr *);
- if (ip6->ip6_hlim != 255) {
+ if (__predict_false(ip6->ip6_hlim != 255)) {
+ ICMP6STAT_INC(icp6s_invlhlim);
nd6log((LOG_ERR,
"%s: invalid hlim (%d) from %s to %s on %s\n", __func__,
ip6->ip6_hlim, ip6_sprintf(ip6bufs, &ip6->ip6_src),
Index: head/usr.bin/netstat/inet6.c
===================================================================
--- head/usr.bin/netstat/inet6.c
+++ head/usr.bin/netstat/inet6.c
@@ -1063,6 +1063,8 @@
"{N:/neighbour entries overflow%s}\n");
p(icp6s_overflowredirect, "\t{:redirect-overflows/%ju} "
"{N:/redirect overflow%s}\n");
+ p(icp6s_invlhlim, "\t{:dropped-invalid-hop-limit/%ju} "
+ "{N:/message%s with invalid hop limit}\n");
xo_close_container("errors");
p(icp6s_pmtuchg, "\t{:path-mtu-changes/%ju} {N:/path MTU change%s}\n");
#undef p
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Sep 12, 5:44 AM (5 h, 36 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
38771143
Default Alt Text
D26578.diff (3 KB)
Attached To
Mode
D26578: nd6: Count packets dropped due to an invalid hop limit
Attached
Detach File
Event Timeline
Log In to Comment