]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
Remove truncation of position (blanking) code in refclock_nmea.c
authorDave Hart <hart@ntp.org>
Sun, 26 Apr 2009 14:17:47 +0000 (14:17 +0000)
committerDave Hart <hart@ntp.org>
Sun, 26 Apr 2009 14:17:47 +0000 (14:17 +0000)
bk: 49f46d0blqCDgtCGwBOYEJvy4jTHgw

ChangeLog
ntpd/refclock_nmea.c

index f29d8999fb1d637a1e56e611b8f0607125891d7d..5f1979d616cef6a253426655a52870f6fc487fa7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,4 @@
+* Remove truncation of position (blanking) code in refclock_nmea.c
 (4.2.5p167) 2009/04/26 Released by Harlan Stenn <stenn@ntp.org>
 * Crypto cleanup from Dave Mills.
 (4.2.5p166) 2009/04/25 Released by Harlan Stenn <stenn@ntp.org>
index ebf35ca1e7390aff54ea7ccf9013c77bd5f729f3..67e9e77d8774901884e7084fba1915900a548813 100644 (file)
@@ -491,10 +491,9 @@ nmea_receive(
        struct refclockproc *pp;
        struct peer *peer;
        int month, day;
-       char *cp, *dp, *bp, *msg;
+       char *cp, *dp, *msg;
        int cmdtype;
        int cmdtypezdg = 0;
-       int blanking;
        /* Use these variables to hold data until we decide its worth keeping */
        char    rd_lastcode[BMAX];
        l_fp    rd_timestamp;
@@ -792,75 +791,6 @@ nmea_receive(
        }
        pp->day = day;
 
-       /*
-        * ntpq -c clockvar clients don't really need to know our 
-        * position with perfect accuracy, so for privacy blank
-        * out least significant digits.  To avoid leaking the
-        * omitted info indirectly, also blank checksum.
-        *
-        * Start by pointing cp and dp at the fields with 
-        * longitude and latitude in the last timecode.
-        */
-       switch (cmdtype) {
-
-           case GPGLL:
-               cp = field_parse(pp->a_lastcode, 1);
-               dp = field_parse(cp, 2);
-               break;
-
-           case GPGGA:
-               cp = field_parse(pp->a_lastcode, 2);
-               dp = field_parse(cp, 2);
-               break;
-
-           case GPRMC:
-               cp = field_parse(pp->a_lastcode, 3);
-               dp = field_parse(cp, 2);
-               break;
-
-           case GPZDG_ZDA:
-           default:
-               cp = dp = NULL;
-       }
-
-       /*
-        * Blanking everything after the decimal point '.' is easy and 
-        * gives enough error for at least a few neighbors to be as 
-        * likely as you to be the one with the reflock.  We're keeping
-        * degrees and minutes but tossing the seconds (expressed as
-        * decimal fractions of a minute).  Degrees minutes seconds,
-        * not hours minutes seconds.  :)
-        */
-       bp = cp;
-       while (bp) {
-               blanking = 0;
-               while (',' != *bp) {
-                       if (blanking)
-                               *bp = '_';
-                       else if ('.' == *bp)
-                               blanking = 1;
-                       bp++;
-               }
-
-               /*
-                * blank the longitude at cp then the latitude at dp
-                * then we're done.
-                */
-               if (bp < dp)
-                       bp = dp;
-               else
-                       bp = NULL;
-       }
-
-       /*
-        * blank the checksum, last two characters on the line
-        */
-       if (cp) {
-               bp = pp->a_lastcode + pp->lencode - 2;
-               if (0 == bp[2])
-                       bp[0] = bp[1] = '_';
-       }
-
 #ifdef HAVE_PPSAPI
        /*
         * If the PPSAPI is working, rather use its timestamps.