#endif
char *meshlink_get_local_address_for_family(meshlink_handle_t *mesh, int family) {
- (void)mesh;
+ if(!mesh) {
+ meshlink_errno = MESHLINK_EINVAL;
+ return NULL;
+ }
// Determine address of the local interface used for outgoing connections.
char localaddr[NI_MAXHOST];
node_t *n = utcp_connection->utcp->priv;
meshlink_handle_t *mesh = n->mesh;
- if(n->mtuprobes == 31) {
+ if(n->mtuprobes == 31 && n->mtutimeout.cb) {
timeout_set(&mesh->loop, &n->mtutimeout, &(struct timespec) {
0, 0
});
}
void meshlink_set_channel_sndbuf(meshlink_handle_t *mesh, meshlink_channel_t *channel, size_t size) {
- (void)mesh;
-
- if(!channel) {
+ if(!mesh || !channel) {
meshlink_errno = MESHLINK_EINVAL;
return;
}
}
void meshlink_set_channel_rcvbuf(meshlink_handle_t *mesh, meshlink_channel_t *channel, size_t size) {
- (void)mesh;
-
- if(!channel) {
+ if(!mesh || !channel) {
meshlink_errno = MESHLINK_EINVAL;
return;
}