Skip to content

Commit 131f3b8

Browse files
authored
Merge pull request #721 from renzibei/dev
make it compilable under O2 optimization, pass gcc check
2 parents ee9f90d + fb832ef commit 131f3b8

File tree

11 files changed

+25
-22
lines changed

11 files changed

+25
-22
lines changed

freebsd/kern/kern_uuid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ kern_uuidgen(struct uuid *store, size_t count)
162162
uuid.time.x.low = (uint32_t)time;
163163
uuid.time.x.mid = (uint16_t)(time >> 32);
164164
uuid.time.x.hi = ((uint16_t)(time >> 48) & 0xfff) | (1 << 12);
165-
store[n] = *(struct uuid *)&uuid;
165+
memcpy(store + n, &uuid, sizeof(struct uuid));
166166
time++;
167167
}
168168

freebsd/net/if.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ if_alloc_domain(u_char type, int numa_domain)
594594
{
595595
struct ifnet *ifp;
596596
u_short idx;
597-
void *old;
597+
void *old = NULL;
598598

599599
KASSERT(numa_domain <= IF_NODOM, ("numa_domain too large"));
600600
if (numa_domain == IF_NODOM)

freebsd/net/route/route_ifaddrs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ rib_handle_ifaddr_one(uint32_t fibnum, int cmd, struct rt_addrinfo *info)
100100
int
101101
rib_handle_ifaddr_info(uint32_t fibnum, int cmd, struct rt_addrinfo *info)
102102
{
103-
int error, last_error = 0;
103+
int error = 0, last_error = 0;
104104
bool didwork = false;
105105

106106
if (V_rt_add_addr_allfibs == 0) {

freebsd/netinet/in_pcb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ in_pcb_lport_dest(struct inpcb *inp, struct sockaddr *lsa, u_short *lportp,
692692
struct in_addr laddr, faddr;
693693
#endif
694694
#ifdef INET6
695-
struct in6_addr *laddr6, *faddr6;
695+
struct in6_addr *laddr6 = NULL, *faddr6 = NULL;
696696
#endif
697697

698698
pcbinfo = inp->inp_pcbinfo;

freebsd/netinet/tcp_stacks/bbr.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11395,7 +11395,7 @@ bbr_do_segment_nounlock(struct mbuf *m, struct tcphdr *th, struct socket *so,
1139511395
int32_t nxt_pkt, struct timeval *tv)
1139611396
{
1139711397
int32_t thflags, retval;
11398-
uint32_t cts, lcts;
11398+
uint32_t cts, lcts = 0;
1139911399
uint32_t tiwin;
1140011400
struct tcpopt to;
1140111401
struct tcp_bbr *bbr;
@@ -11957,7 +11957,7 @@ bbr_output_wtime(struct tcpcb *tp, const struct timeval *tv)
1195711957
struct socket *so;
1195811958
int32_t len;
1195911959
uint32_t cts;
11960-
uint32_t recwin, sendwin;
11960+
uint32_t recwin = 0, sendwin;
1196111961
int32_t sb_offset;
1196211962
int32_t flags, abandon, error = 0;
1196311963
struct tcp_log_buffer *lgb = NULL;

freebsd/netinet/tcp_stacks/rack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11878,13 +11878,13 @@ static int
1187811878
rack_output(struct tcpcb *tp)
1187911879
{
1188011880
struct socket *so;
11881-
uint32_t recwin;
11881+
uint32_t recwin = 0;
1188211882
uint32_t sb_offset;
1188311883
int32_t len, flags, error = 0;
1188411884
struct mbuf *m;
1188511885
struct mbuf *mb;
1188611886
uint32_t if_hw_tsomaxsegcount = 0;
11887-
uint32_t if_hw_tsomaxsegsize;
11887+
uint32_t if_hw_tsomaxsegsize = 0;
1188811888
int32_t segsiz, minseg;
1188911889
long tot_len_this_send = 0;
1189011890
struct ip *ip = NULL;

freebsd/netinet/tcp_stacks/rack_bbr_common.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ ctf_process_inbound_raw(struct tcpcb *tp, struct socket *so, struct mbuf *m, int
248248
*/
249249
struct mbuf *m_save;
250250
struct ether_header *eh;
251-
struct tcphdr *th;
251+
struct tcphdr *th = NULL;
252252
#ifdef INET6
253253
struct ip6_hdr *ip6 = NULL; /* Keep compiler happy. */
254254
#endif
@@ -257,10 +257,10 @@ ctf_process_inbound_raw(struct tcpcb *tp, struct socket *so, struct mbuf *m, int
257257
#endif
258258
struct ifnet *ifp;
259259
struct timeval tv;
260-
int32_t retval, nxt_pkt, tlen, off;
260+
int32_t retval, nxt_pkt, tlen = 0, off;
261261
uint16_t etype;
262-
uint16_t drop_hdrlen;
263-
uint8_t iptos, no_vn=0, bpf_req=0;
262+
uint16_t drop_hdrlen = 0;
263+
uint8_t iptos = 0, no_vn=0, bpf_req=0;
264264

265265
NET_EPOCH_ASSERT();
266266

freebsd/netinet/tcp_usrreq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,16 +1006,16 @@ tcp_usr_send(struct socket *so, int flags, struct mbuf *m,
10061006
{
10071007
struct epoch_tracker et;
10081008
int error = 0;
1009-
struct inpcb *inp;
1009+
struct inpcb *inp = NULL;
10101010
struct tcpcb *tp = NULL;
10111011
#ifdef INET
10121012
#ifdef INET6
10131013
struct sockaddr_in sin;
10141014
#endif
1015-
struct sockaddr_in *sinp;
1015+
struct sockaddr_in *sinp = NULL;
10161016
#endif
10171017
#ifdef INET6
1018-
int isipv6;
1018+
int isipv6 = 0;
10191019
#endif
10201020
u_int8_t incflagsav;
10211021
u_char vflagsav;

freebsd/netinet6/nd6.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1242,7 +1242,7 @@ nd6_is_new_addr_neighbor(const struct sockaddr_in6 *addr, struct ifnet *ifp)
12421242
struct sockaddr_in6 rt_key;
12431243
const struct sockaddr *dst6;
12441244
uint64_t genid;
1245-
int error, fibnum;
1245+
int error = 0, fibnum;
12461246

12471247
/*
12481248
* A link-local address is always a neighbor.

lib/ff_dpdk_if.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,6 +705,9 @@ init_port_start(void)
705705
port_conf.txmode.offloads |= DEV_TX_OFFLOAD_TCP_TSO;
706706
pconf->hw_features.tx_tso = 1;
707707
}
708+
else {
709+
printf("TSO is not supported\n");
710+
}
708711
} else {
709712
printf("TSO is disabled\n");
710713
}

0 commit comments

Comments
 (0)