-/* $OpenBSD: udp.c,v 1.94 2007/04/16 13:01:39 moritz Exp $ */
+/* $OpenBSD: udp.c,v 1.95 2008/07/22 09:45:56 bluhm Exp $ */
/* $EOM: udp.c,v 1.57 2001/01/26 10:09:57 niklas Exp $ */
/*
{
struct virtual_transport *v;
struct udp_transport *u;
- struct transport *rv;
+ struct transport *rv = 0;
struct sockaddr *dst, *addr;
char *addr_str, *port_str;
struct conf_list *addr_list = 0;
addr_list = conf_get_list("General", "Listen-on");
if (!addr_str && !addr_list) {
v = virtual_get_default(dst->sa_family);
+ if (!v) {
+ log_print("udp_create: no virtual default transport "
+ "for address family %d", dst->sa_family);
+ goto ret;
+ }
u = (struct udp_transport *)v->main;
-
if (!u) {
- log_print("udp_create: no default transport");
- rv = 0;
- goto ret;
- } else {
- rv = udp_clone((struct transport *)u, dst);
- if (rv)
- rv->vtbl = &udp_transport_vtbl;
+ log_print("udp_create: no udp default transport "
+ "for address family %d", dst->sa_family);
goto ret;
}
+ rv = udp_clone((struct transport *)u, dst);
+ if (rv)
+ rv->vtbl = &udp_transport_vtbl;
+ goto ret;
}
if (addr_list) {
}
if (!addr_str) {
log_print("udp_create: no matching listener found");
- rv = 0;
goto ret;
}
}
if (text2sockaddr(addr_str, port_str, &addr, 0, 0)) {
log_print("udp_create: address \"%s\" not understood",
addr_str);
- rv = 0;
goto ret;
}
if (!v) {
log_print("udp_create: %s:%s must exist as a listener too",
addr_str, port_str);
- rv = 0;
goto ret;
}
rv = udp_clone(v->main, dst);