From 3a0a62b7808db21a3c46db0b2f9b9e16802498b0 Mon Sep 17 00:00:00 2001 From: gardners Date: Wed, 28 Mar 2012 13:19:53 +1030 Subject: [PATCH] Fixed source address of MDP echo frames when destination of echo request was broadcast (returns local address or all zeroes). --- overlay_mdp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/overlay_mdp.c b/overlay_mdp.c index 7134ad03..ac80fe47 100644 --- a/overlay_mdp.c +++ b/overlay_mdp.c @@ -351,6 +351,16 @@ int overlay_saw_mdp_frame(int interface, overlay_mdp_frame *mdp,long long now) bcopy(&mdp->out.dst,&temp,sizeof(sockaddr_mdp)); bcopy(&mdp->out.src,&mdp->out.dst,sizeof(sockaddr_mdp)); bcopy(&temp,&mdp->out.src,sizeof(sockaddr_mdp)); + /* If the packet was sent to broadcast, then replace broadcast address + with our local address. For now just responds with first local address */ + if (overlay_address_is_broadcast(mdp->out.src.sid)) + { + if (overlay_local_identity_count) + bcopy(&overlay_local_identities[0][0],mdp->out.src.sid,SID_SIZE); + else + /* No local addresses, so put all zeroes */ + bzero(mdp->out.src.sid,SID_SIZE); + } /* queue frame for delivery */ return