diff --git a/mdp_jni.c b/mdp_jni.c index 6f1dd2be..96480326 100644 --- a/mdp_jni.c +++ b/mdp_jni.c @@ -256,7 +256,7 @@ Java_org_servalproject_servald_mdp_MeshSocket__1send(JNIEnv * env, /* Fill mdp structure. */ - mdp.packetTypeAndFlags = MDP_TX | flags & MDP_FLAG_MASK; + mdp.packetTypeAndFlags = MDP_TX | (flags & MDP_FLAG_MASK); mdp.out.queue = qos; mdp.out.src.port = localport; if (localsid != NULL) { @@ -313,7 +313,7 @@ Java_org_servalproject_servald_mdp_MeshSocket__1receive(JNIEnv * env, length = (*env)->GetIntField(env, mdppack, f_meshpacket_length); /* Receive data. */ - if (res = (overlay_mdp_recv(fd, &mdp, localport, &ttl))) { + if ((res = (overlay_mdp_recv(fd, &mdp, localport, &ttl)))) { if (res == -2) { /* Socket is closed. */ msg = "Socket closed";