PUD: initially pick ourselves as the best gateway
authorFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 5 Mar 2012 09:57:20 +0000 (10:57 +0100)
committerFerry Huberts <ferry.huberts@pelagic.nl>
Mon, 5 Mar 2012 09:58:57 +0000 (10:58 +0100)
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
lib/pud/src/receiver.c

index 036a577..4b35986 100644 (file)
@@ -915,6 +915,7 @@ bool startReceiver(void) {
 
        nmea_zero_INFO(&txPosition.nmeaInfo);
        memset(&txGateway, 0, sizeof(txGateway));
+       memcpy(&txGateway, &olsr_cnf->main_addr, olsr_cnf->ipsize);
 
        state.internalState = MOVING;
        state.externalState = MOVING;
@@ -952,6 +953,7 @@ void stopReceiver(void) {
        state.internalState = MOVING;
 
        memset(&txGateway, 0, sizeof(txGateway));
+       memcpy(&txGateway, &olsr_cnf->main_addr, olsr_cnf->ipsize);
        nmea_zero_INFO(&txPosition.nmeaInfo);
 
        transmitGpsInformation.updated = false;