<html lang='en'>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type'>
<title>
GitLab
</title>
</meta>
</head>
<style>
  img {
    max-width: 100%;
    height: auto;
  }
  p.details {
    font-style:italic;
    color:#777
  }
  .footer p {
    font-size:small;
    color:#777
  }
  pre.commit-message {
    white-space: pre-wrap;
  }
  .file-stats a {
    text-decoration: none;
  }
  .file-stats .new-file {
    color: #090;
  }
  .file-stats .deleted-file {
    color: #B00;
  }
</style>
<body>
<div class='content'>
<h3>Eric S. Raymond pushed to branch master at <a href="https://gitlab.com/NTPsec/ntpsec">NTPsec / ntpsec</a></h3>
<h4>
Commits:
</h4>
<ul>
<li>
<strong><a href="https://gitlab.com/NTPsec/ntpsec/commit/813f50ee4285d17350c306fa8b3a4369d6dd2018">813f50ee</a></strong>
<div>
<span>by Eric S. Raymond</span>
<i>at 2015-12-07T07:40:47Z</i>
</div>
<pre class='commit-message'>Record ucast/bcast/mcast flags in a packet's buffer when received...

...rather than computing them in ntp_monitor.c, in order to avoid having
to keep data (the socket fd) that cannot be serialized into a replay file.

The SOCKET fd field is now used only for purging fd-associated recvbufs (which
will be bypassed in replay mode) and for diagnostic messages on the refclock
side of things.</pre>
</li>
</ul>
<h4>3 changed files:</h4>
<ul>
<li class='file-stats'>
<a href='#diff-0'>
include/recvbuff.h
</a>
</li>
<li class='file-stats'>
<a href='#diff-1'>
ntpd/ntp_io.c
</a>
</li>
<li class='file-stats'>
<a href='#diff-2'>
ntpd/ntp_monitor.c
</a>
</li>
</ul>
<h4>Changes:</h4>
<li id='diff-0'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/813f50ee4285d17350c306fa8b3a4369d6dd2018#diff-0'>
<strong>
include/recvbuff.h
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/include/recvbuff.h
</span><span style="color: #000000;background-color: #ddffdd">+++ b/include/recvbuff.h
</span><span style="color: #aaaaaa">@@ -61,6 +61,7 @@ struct recvbuf {
</span> #endif
        endpt *         dstadr;         /* address pkt arrived on */
        SOCKET          fd;             /* fd on which it was received */
<span style="color: #000000;background-color: #ddffdd">+        int             cast_flags;     /* unicast/broadcast/manycast mode */
</span>   l_fp            recv_time;      /* time of arrival */
        void            (*receiver)(struct recvbuf *); /* callback */
        size_t          recv_length;    /* number of octets received */
</code></pre>

<br>
</li>
<li id='diff-1'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/813f50ee4285d17350c306fa8b3a4369d6dd2018#diff-1'>
<strong>
ntpd/ntp_io.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_io.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_io.c
</span><span style="color: #aaaaaa">@@ -3282,6 +3282,7 @@ read_refclock_packet(
</span>   rb->recv_length = buflen;
        rb->recv_peer = rp->srcclock;
        rb->dstadr = 0;
<span style="color: #000000;background-color: #ddffdd">+        rb->cast_flags = 0;
</span>   rb->fd = fd;
        rb->recv_time = ts;
        rb->receiver = rp->clock_recv;
<span style="color: #aaaaaa">@@ -3540,6 +3541,9 @@ read_network_packet(
</span>    * put it on the full list and do bookkeeping.
         */
        rb->dstadr = itf;
<span style="color: #000000;background-color: #ddffdd">+        rb->cast_flags = (uint8_t)(((rb->dstadr->flags &
+                                    INT_MCASTOPEN) && rb->fd == rb->dstadr->fd) ? MDF_MCAST
+                                  : rb->fd == rb->dstadr->bfd ? MDF_BCAST : MDF_UCAST);
</span>   rb->fd = fd;
 #ifdef USE_PACKET_TIMESTAMP
        /* pick up a network time stamp if possible */
</code></pre>

<br>
</li>
<li id='diff-2'>
<a href='https://gitlab.com/NTPsec/ntpsec/commit/813f50ee4285d17350c306fa8b3a4369d6dd2018#diff-2'>
<strong>
ntpd/ntp_monitor.c
</strong>
</a>
<hr>
<pre class="highlight"><code><span style="color: #000000;background-color: #ffdddd">--- a/ntpd/ntp_monitor.c
</span><span style="color: #000000;background-color: #ddffdd">+++ b/ntpd/ntp_monitor.c
</span><span style="color: #aaaaaa">@@ -478,9 +478,7 @@ ntp_monitor(
</span>   memcpy(&mon->rmtadr, &rbufp->recv_srcadr, sizeof(mon->rmtadr));
        mon->vn_mode = VN_MODE(version, mode);
        mon->lcladr = rbufp->dstadr;
<span style="color: #000000;background-color: #ffdddd">-        mon->cast_flags = (uint8_t)(((rbufp->dstadr->flags &
-           INT_MCASTOPEN) && rbufp->fd == mon->lcladr->fd) ? MDF_MCAST
-           : rbufp->fd == mon->lcladr->bfd ? MDF_BCAST : MDF_UCAST);
</span><span style="color: #000000;background-color: #ddffdd">+   mon->cast_flags = rbufp->cast_flags;
</span> 
        /*
         * Drop him into front of the hash table. Also put him on top of
</code></pre>

<br>
</li>

</div>
<div class='footer' style='margin-top: 10px;'>
<p>

<br>
<a href="https://gitlab.com/NTPsec/ntpsec/commit/813f50ee4285d17350c306fa8b3a4369d6dd2018">View it on GitLab</a>.
<br>
You're receiving this email because of your account on gitlab.com.
If you'd like to receive fewer emails, you can adjust your notification settings.
<script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","action":{"@type":"ViewAction","name":"View Commit","url":"https://gitlab.com/NTPsec/ntpsec/commit/813f50ee4285d17350c306fa8b3a4369d6dd2018"}}</script>
</p>
</div>
</body>
</html>