~mdw
/
secnet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
udp: Break out udp_destroy_socket
[secnet]
/
udp.c
diff --git
a/udp.c
b/udp.c
index
838fd51
..
30bf73f
100644
(file)
--- a/
udp.c
+++ b/
udp.c
@@
-183,6
+183,14
@@
static bool_t udp_sendmsg(void *commst, struct buffer_if *buf,
return True;
}
return True;
}
+void udp_destroy_socket(struct udpcommon *uc, struct udpsock *us)
+{
+ if (us->fd>=0) {
+ close(us->fd);
+ us->fd=-1;
+ }
+}
+
bool_t udp_make_socket(struct udpcommon *uc, struct udpsock *us,
int failmsgclass)
{
bool_t udp_make_socket(struct udpcommon *uc, struct udpsock *us,
int failmsgclass)
{
@@
-276,10
+284,7
@@
bool_t udp_make_socket(struct udpcommon *uc, struct udpsock *us,
return True;
failed:
return True;
failed:
- if (us->fd>=0) {
- close(us->fd);
- us->fd=-1;
- }
+ udp_destroy_socket(uc,us);
return False;
#undef FAIL
return False;
#undef FAIL