Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F144477190
D39622.id120497.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D39622.id120497.diff
View Options
Index: sys/netinet/tcp_log_buf.c
===================================================================
--- sys/netinet/tcp_log_buf.c
+++ sys/netinet/tcp_log_buf.c
@@ -554,7 +554,10 @@
INP_WUNLOCK(inp);
return (EOPNOTSUPP);
}
- ratio_hash_thresh = max(1, UINT32_MAX / ratio);
+ if (ratio)
+ ratio_hash_thresh = max(1, UINT32_MAX / ratio);
+ else
+ ratio_hash_thresh = 0;
TCPID_BUCKET_REF(tlb);
INP_WUNLOCK(inp);
TCPID_BUCKET_LOCK(tlb);
@@ -1438,30 +1441,37 @@
memset(&log, 0, sizeof(log));
if (tp->t_flags2 & TF2_TCP_ACCOUNTING) {
- for (i = 0; i<TCP_NUM_CNT_COUNTERS; i++) {
+ for (i = 0; i < TCP_NUM_CNT_COUNTERS; i++) {
log.u_raw.u64_flex[i] = tp->tcp_cnt_counters[i];
}
lgb = tcp_log_event(tp, NULL,
- NULL,
- NULL,
- TCP_LOG_ACCOUNTING, 0,
- 0, &log, false, NULL, NULL, 0, &tv);
- lgb->tlb_flex1 = TCP_NUM_CNT_COUNTERS;
- lgb->tlb_flex2 = 1;
- for (i = 0; i<TCP_NUM_CNT_COUNTERS; i++) {
- log.u_raw.u64_flex[i] = tp->tcp_proc_time[i];
- }
+ NULL,
+ NULL,
+ TCP_LOG_ACCOUNTING, 0,
+ 0, &log, false, NULL, NULL, 0, &tv);
+ if (lgb != NULL) {
+ lgb->tlb_flex1 = TCP_NUM_CNT_COUNTERS;
+ lgb->tlb_flex2 = 1;
+ for (i = 0; i<TCP_NUM_CNT_COUNTERS; i++) {
+ log.u_raw.u64_flex[i] = tp->tcp_proc_time[i];
+ }
+ } else
+ goto skip_out;
+
lgb = tcp_log_event(tp, NULL,
- NULL,
- NULL,
- TCP_LOG_ACCOUNTING, 0,
- 0, &log, false, NULL, NULL, 0, &tv);
- if (tptoinpcb(tp)->inp_flags2 & INP_MBUF_ACKCMP)
+ NULL,
+ NULL,
+ TCP_LOG_ACCOUNTING, 0,
+ 0, &log, false, NULL, NULL, 0, &tv);
+ if (lgb != NULL) {
lgb->tlb_flex1 = TCP_NUM_CNT_COUNTERS;
- else
- lgb->tlb_flex1 = TCP_NUM_PROC_COUNTERS;
- lgb->tlb_flex2 = 2;
+ lgb->tlb_flex2 = 2;
+ for (i = 0; i < TCP_NUM_CNT_COUNTERS; i++) {
+ log.u_raw.u64_flex[i] = tp->tcp_cnt_counters[i];
+ }
+ }
}
+skip_out:
log.u_bbr.timeStamp = tcp_get_usecs(&tv);
log.u_bbr.cur_del_rate = tp->t_end_info;
TCP_LOG_EVENTP(tp, NULL,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 9, 3:44 PM (18 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28595894
Default Alt Text
D39622.id120497.diff (2 KB)
Attached To
Mode
D39622: tcp: Blackbox logging and tcp accounting together can cause a crash.
Attached
Detach File
Event Timeline
Log In to Comment