<div dir="ltr">Dear OTP team,<div>I sent this to erlang-patches but doesn't look like it got circulated. Hope this helps someone.</div><div><br></div><div>regards,</div><div>Sharmila.<br><br><div class="gmail_quote">---------- Forwarded message ----------<br>
From: <b class="gmail_sendername">Sharmila Pillai</b> <span dir="ltr"><<a href="mailto:pillai.sharmila@gmail.com">pillai.sharmila@gmail.com</a>></span><br>Date: Mon, Nov 25, 2013 at 8:16 PM<br>Subject: Bug fix for DWR handling in R16B02<br>
To: <a href="mailto:erlang-patches@erlang.org">erlang-patches@erlang.org</a><br><br><br><div dir="ltr">Hi,<br><br>We were testing our PCRF implementation using the diameter stack and found that DWRs did not have a corresponding DWA.<br>
This I found was because the Hop-by-hop identifier and End-to-end identifier in the diameter_header weren't echoed back in a DWA (reference: <a href="http://tools.ietf.org/html/rfc3588#section-3" target="_blank">http://tools.ietf.org/html/rfc3588#section-3</a>) but a new locally generated one was being sent. Patch below fixes the problem.<br>
<br><br>$ diff diameter_watchdog.erl ~/temp/diameter_watchdog.erl <br>465,468c465,479<br>< Seq = diameter_session:sequence(Mask),<br>< Hdr = #diameter_header{version = ?DIAMETER_VERSION,<br>< end_to_end_id = Seq,<br>
< hop_by_hop_id = Seq},<br>---<br>> encode(undefined, Msg, Mask, Dict).<br>> <br>> encode(Req_pkt, Msg, Mask, Dict) -><br>> Hdr = case Req_pkt of<br>> undefined -><br>
> Seq = diameter_session:sequence(Mask),<br>> #diameter_header{version = ?DIAMETER_VERSION,<br>> end_to_end_id = Seq,<br>> hop_by_hop_id = Seq};<br>
> #diameter_packet{header = #diameter_header{hop_by_hop_id = H2H,<br>> end_to_end_id = E2E}} -><br>> #diameter_header{version = ?DIAMETER_VERSION,<br>
> end_to_end_id = E2E,<br>> hop_by_hop_id = H2H}<br>> end,<br>551c562<br>< send(TPid, {send, encode(dwa(Pkt), Mask, Dict0)}),<br>
---<br>> send(TPid, {send, encode(Pkt, dwa(Pkt), Mask, Dict0)}),<br>795c806,808<br>< dwa(#diameter_packet{header = H, errors = Es}) -><br>---<br>> dwa(#diameter_packet{header = #diameter_header{hop_by_hop_id = H2H,<br>
> end_to_end_id = E2E} = H,<br>> errors = Es}) -><br><div><br></div><div><br></div><div>best wishes,</div><div>Sharmila.</div></div>
</div><br></div></div>