Skip to content

Commit 7f8342e

Browse files
committed
net/udp: fix build error when NET_UDP_WRITE_BUFFERS disable
fix build error. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
1 parent 633d6d0 commit 7f8342e

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

net/procfs/net_udp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,13 @@ static ssize_t netprocfs_udpstats(FAR struct netprocfs_file_s *priv,
9595
len += snprintf(buffer + len, buflen - len,
9696
" %2" PRIu8
9797
": %3" PRIx8
98-
#if CONFIG_NET_SEND_BUFSIZE > 0
98+
#ifdef CONFIG_NET_UDP_WRITE_BUFFERS
9999
" %6" PRIu32
100100
#endif
101101
" %6u",
102102
priv->offset++,
103103
conn->sconn.s_flags,
104-
#if CONFIG_NET_SEND_BUFSIZE > 0
104+
#ifdef CONFIG_NET_UDP_WRITE_BUFFERS
105105
udp_wrbuffer_inqueue_size(conn),
106106
#endif
107107
(conn->readahead) ? conn->readahead->io_pktlen : 0);

net/udp/udp.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -579,9 +579,7 @@ void udp_wrbuffer_release(FAR struct udp_wrbuffer_s *wrb);
579579
*
580580
****************************************************************************/
581581

582-
#if CONFIG_NET_SEND_BUFSIZE > 0
583582
uint32_t udp_wrbuffer_inqueue_size(FAR struct udp_conn_s *conn);
584-
#endif /* CONFIG_NET_SEND_BUFSIZE */
585583

586584
/****************************************************************************
587585
* Name: udp_wrbuffer_test

net/udp/udp_ioctl.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,25 +67,29 @@ static void udp_path(FAR struct udp_conn_s *conn, FAR char *buf, size_t len)
6767

6868
snprintf(buf, len, "udp:["
6969
"%s:%" PRIu16 "<->%s:%" PRIu16
70-
#if CONFIG_NET_SEND_BUFSIZE > 0
7170
", tx %" PRIu32 "/%" PRId32
72-
#endif
73-
#if CONFIG_NET_RECV_BUFSIZE > 0
7471
", rx %u/%" PRId32
75-
#endif
7672
", flg %" PRIx8
7773
"]",
7874
inet_ntop(domain, laddr, local, sizeof(local)),
7975
ntohs(conn->lport),
8076
inet_ntop(domain, raddr, remote, sizeof(remote)),
8177
ntohs(conn->rport),
82-
#if CONFIG_NET_SEND_BUFSIZE > 0
78+
#ifdef CONFIG_NET_UDP_WRITE_BUFFERS
8379
udp_wrbuffer_inqueue_size(conn),
80+
#else
81+
(uint32_t)0,
82+
#endif
83+
#if CONFIG_NET_SEND_BUFSIZE > 0
8484
conn->sndbufs,
85+
#else
86+
(int32_t)0,
8587
#endif
86-
#if CONFIG_NET_RECV_BUFSIZE > 0
8788
(conn->readahead) ? conn->readahead->io_pktlen : 0,
89+
#if CONFIG_NET_RECV_BUFSIZE > 0
8890
conn->rcvbufs,
91+
#else
92+
(int32_t)0,
8993
#endif
9094
conn->sconn.s_flags
9195
);

net/udp/udp_wrbuffer.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ void udp_wrbuffer_release(FAR struct udp_wrbuffer_s *wrb)
262262
*
263263
****************************************************************************/
264264

265-
#if CONFIG_NET_SEND_BUFSIZE > 0
266265
uint32_t udp_wrbuffer_inqueue_size(FAR struct udp_conn_s *conn)
267266
{
268267
FAR struct udp_wrbuffer_s *wrb;
@@ -280,7 +279,6 @@ uint32_t udp_wrbuffer_inqueue_size(FAR struct udp_conn_s *conn)
280279

281280
return total;
282281
}
283-
#endif /* CONFIG_NET_SEND_BUFSIZE */
284282

285283
/****************************************************************************
286284
* Name: udp_wrbuffer_test

0 commit comments

Comments
 (0)