Skip to contentSkip to conversation

net: add random_port() prototype

PATCH New Mike Frysinger 2 participants 2 messages Sep 2, 2009 – Sep 10, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: add random_port() prototype

The random_port() is meant to be used by other net code, but without a prototype, we get fun warnings like:
dns.c: In function 'DnsSend':
dns.c:89: warning: implicit declaration of function 'random_port'

---
 include/net.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/net.h +3 -0
index 4873000..1c8ab12 100644
@@ -517,6 +517,9 @@ extern ushort getenv_VLAN(char *);
 /* copy a filename (allow for "..." notation, limit length) */
 extern void	copy_filename (char *dst, char *src, int size);
 
+/* get a random source port */
+extern unsigned int random_port(void);
+
 /**********************************************************************/
 
 #endif /* __NET_H__ */
Signature · 1 line
1.6.4.2
Applied
#1 lore raw

PATCH 1/1 net: add random_port() prototype

Quoted 16 lines · Mike Frysinger

The random_port() is meant to be used by other net code, but without a prototype, we get fun warnings like:
dns.c: In function 'DnsSend':
dns.c:89: warning: implicit declaration of function 'random_port'

---
 include/net.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
include/net.h +0 -0
index 4873000..1c8ab12 100644

include/net.h extern ushort getenv_VLAN(char *); · line 525

Quoted 9 lines
include/net.h +3 -0
@@ -517,6 +517,9 @@ extern ushort getenv_VLAN(char *);
 /* copy a filename (allow for "..." notation, limit length) */
 extern void	copy_filename (char *dst, char *src, int size);
 
+/* get a random source port */
+extern unsigned int random_port(void);
+
 /**********************************************************************/
 
 #endif /* __NET_H__ */

Applied to net repo.

thanks,
Ben