btrbk: add mainProgram
[NixPkgs.git] / pkgs / by-name / us / usrsctp / clang-fix-build.patch
blobeb136e8be30ab4cf952011074e32dacdf5651f6c
1 diff --git a/usrsctplib/netinet/sctp_cc_functions.c b/usrsctplib/netinet/sctp_cc_functions.c
2 index 57bcdaa..70cf8b7 100755
3 --- a/usrsctplib/netinet/sctp_cc_functions.c
4 +++ b/usrsctplib/netinet/sctp_cc_functions.c
5 @@ -764,7 +764,7 @@ sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb,
6 #if defined(__FreeBSD__) && !defined(__Userspace__)
7 int old_cwnd;
8 #endif
9 - uint32_t t_ssthresh, t_cwnd, incr;
10 + uint32_t t_ssthresh, incr;
11 uint64_t t_ucwnd_sbw;
12 uint64_t t_path_mptcp;
13 uint64_t mptcp_like_alpha;
14 @@ -773,7 +773,6 @@ sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb,
16 /* MT FIXME: Don't compute this over and over again */
17 t_ssthresh = 0;
18 - t_cwnd = 0;
19 t_ucwnd_sbw = 0;
20 t_path_mptcp = 0;
21 mptcp_like_alpha = 1;
22 @@ -783,7 +782,6 @@ sctp_cwnd_update_after_sack_common(struct sctp_tcb *stcb,
23 max_path = 0;
24 TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
25 t_ssthresh += net->ssthresh;
26 - t_cwnd += net->cwnd;
27 /* lastsa>>3; we don't need to devide ...*/
28 srtt = net->lastsa;
29 if (srtt > 0) {
30 diff --git a/usrsctplib/netinet/sctp_indata.c b/usrsctplib/netinet/sctp_indata.c
31 index 3bce9e9..42ce111 100755
32 --- a/usrsctplib/netinet/sctp_indata.c
33 +++ b/usrsctplib/netinet/sctp_indata.c
34 @@ -3320,7 +3320,6 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc,
35 struct sctp_tmit_chunk *tp1;
36 int strike_flag = 0;
37 struct timeval now;
38 - int tot_retrans = 0;
39 uint32_t sending_seq;
40 struct sctp_nets *net;
41 int num_dests_sacked = 0;
42 @@ -3691,7 +3690,6 @@ sctp_strike_gap_ack_chunks(struct sctp_tcb *stcb, struct sctp_association *asoc,
45 tp1->rec.data.doing_fast_retransmit = 1;
46 - tot_retrans++;
47 /* mark the sending seq for possible subsequent FR's */
49 * SCTP_PRINTF("Marking TSN for FR new value %x\n",
50 diff --git a/usrsctplib/netinet/sctp_output.c b/usrsctplib/netinet/sctp_output.c
51 index 6a7dff9..a914b3b 100755
52 --- a/usrsctplib/netinet/sctp_output.c
53 +++ b/usrsctplib/netinet/sctp_output.c
54 @@ -9970,7 +9970,7 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp,
55 struct mbuf *m, *endofchain;
56 struct sctp_nets *net = NULL;
57 uint32_t tsns_sent = 0;
58 - int no_fragmentflg, bundle_at, cnt_thru;
59 + int no_fragmentflg, bundle_at;
60 unsigned int mtu;
61 int error, i, one_chunk, fwd_tsn, ctl_cnt, tmr_started;
62 struct sctp_auth_chunk *auth = NULL;
63 @@ -10046,7 +10046,6 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp,
66 one_chunk = 0;
67 - cnt_thru = 0;
68 /* do we have control chunks to retransmit? */
69 if (m != NULL) {
70 /* Start a timer no matter if we succeed or fail */
71 @@ -10368,7 +10367,6 @@ sctp_chunk_retransmission(struct sctp_inpcb *inp,
72 /* (void)SCTP_GETTIME_TIMEVAL(&net->last_sent_time); */
74 /* For auto-close */
75 - cnt_thru++;
76 if (*now_filled == 0) {
77 (void)SCTP_GETTIME_TIMEVAL(&asoc->time_last_sent);
78 *now = asoc->time_last_sent;
79 @@ -13416,7 +13414,7 @@ sctp_lower_sosend(struct socket *so,
80 struct epoch_tracker et;
81 #endif
82 ssize_t sndlen = 0, max_len, local_add_more;
83 - int error, len;
84 + int error;
85 struct mbuf *top = NULL;
86 int queue_only = 0, queue_only_for_init = 0;
87 int free_cnt_applied = 0;
88 @@ -14035,7 +14033,6 @@ sctp_lower_sosend(struct socket *so,
90 local_add_more = sndlen;
92 - len = 0;
93 if (non_blocking) {
94 goto skip_preblock;
96 @@ -14265,7 +14262,6 @@ skip_preblock:
98 sctp_snd_sb_alloc(stcb, sndout);
99 atomic_add_int(&sp->length, sndout);
100 - len += sndout;
101 if (sinfo_flags & SCTP_SACK_IMMEDIATELY) {
102 sp->sinfo_flags |= SCTP_SACK_IMMEDIATELY;
104 diff --git a/usrsctplib/netinet/sctp_pcb.c b/usrsctplib/netinet/sctp_pcb.c
105 index 89a66bc..a952921 100755
106 --- a/usrsctplib/netinet/sctp_pcb.c
107 +++ b/usrsctplib/netinet/sctp_pcb.c
108 @@ -7943,7 +7943,7 @@ sctp_drain_mbufs(struct sctp_tcb *stcb)
111 void
112 -sctp_drain()
113 +sctp_drain(void)
116 * We must walk the PCB lists for ALL associations here. The system
117 diff --git a/usrsctplib/netinet/sctp_sysctl.c b/usrsctplib/netinet/sctp_sysctl.c
118 index bb49e17..8b77f7e 100755
119 --- a/usrsctplib/netinet/sctp_sysctl.c
120 +++ b/usrsctplib/netinet/sctp_sysctl.c
121 @@ -61,7 +61,7 @@ FEATURE(sctp, "Stream Control Transmission Protocol");
124 void
125 -sctp_init_sysctls()
126 +sctp_init_sysctls(void)
128 SCTP_BASE_SYSCTL(sctp_sendspace) = SCTPCTL_MAXDGRAM_DEFAULT;
129 SCTP_BASE_SYSCTL(sctp_recvspace) = SCTPCTL_RECVSPACE_DEFAULT;
130 diff --git a/usrsctplib/user_socket.c b/usrsctplib/user_socket.c
131 index 513a5a9..89e9eb2 100755
132 --- a/usrsctplib/user_socket.c
133 +++ b/usrsctplib/user_socket.c
134 @@ -2857,7 +2857,6 @@ sctp_userspace_ip_output(int *result, struct mbuf *o_pak,
135 struct mbuf *m_orig;
136 int iovcnt;
137 int len;
138 - int send_count;
139 struct ip *ip;
140 struct udphdr *udp;
141 struct sockaddr_in dst;
142 @@ -2930,16 +2929,13 @@ sctp_userspace_ip_output(int *result, struct mbuf *o_pak,
143 m_adj(m, sizeof(struct ip) + sizeof(struct udphdr));
146 - send_count = 0;
147 for (iovcnt = 0; m != NULL && iovcnt < MAXLEN_MBUF_CHAIN; m = m->m_next, iovcnt++) {
148 #if !defined(_WIN32)
149 send_iovec[iovcnt].iov_base = (caddr_t)m->m_data;
150 send_iovec[iovcnt].iov_len = SCTP_BUF_LEN(m);
151 - send_count += send_iovec[iovcnt].iov_len;
152 #else
153 send_iovec[iovcnt].buf = (caddr_t)m->m_data;
154 send_iovec[iovcnt].len = SCTP_BUF_LEN(m);
155 - send_count += send_iovec[iovcnt].len;
156 #endif
159 @@ -3002,7 +2998,6 @@ void sctp_userspace_ip6_output(int *result, struct mbuf *o_pak,
160 struct mbuf *m_orig;
161 int iovcnt;
162 int len;
163 - int send_count;
164 struct ip6_hdr *ip6;
165 struct udphdr *udp;
166 struct sockaddr_in6 dst;
167 @@ -3076,16 +3071,13 @@ void sctp_userspace_ip6_output(int *result, struct mbuf *o_pak,
168 m_adj(m, sizeof(struct ip6_hdr));
171 - send_count = 0;
172 for (iovcnt = 0; m != NULL && iovcnt < MAXLEN_MBUF_CHAIN; m = m->m_next, iovcnt++) {
173 #if !defined(_WIN32)
174 send_iovec[iovcnt].iov_base = (caddr_t)m->m_data;
175 send_iovec[iovcnt].iov_len = SCTP_BUF_LEN(m);
176 - send_count += send_iovec[iovcnt].iov_len;
177 #else
178 send_iovec[iovcnt].buf = (caddr_t)m->m_data;
179 send_iovec[iovcnt].len = SCTP_BUF_LEN(m);
180 - send_count += send_iovec[iovcnt].len;
181 #endif
183 if (m != NULL) {