[erlang-questions] Fwd: Bug fix for DWR handling in R16B02

Anders Svensson <>
Tue Nov 26 17:44:09 CET 2013


Hi Sharmila.

Yes, the fault was introduced in R16B02 unfortunately. A fix was
pushed to maint/master a few weeks ago:

  https://github.com/erlang/otp/commit/46a1d278fe063ffd08ae9538bb8a496b813fe661

Anders, Erlang/OTP


On Tue, Nov 26, 2013 at 3:20 PM, Sharmila Pillai
<> wrote:
> Dear OTP team,
> I sent this to erlang-patches but doesn't look like it got circulated. Hope
> this helps someone.
>
> regards,
> Sharmila.
>
> ---------- Forwarded message ----------
> From: Sharmila Pillai <>
> Date: Mon, Nov 25, 2013 at 8:16 PM
> Subject: Bug fix for DWR handling in R16B02
> To: 
>
>
> Hi,
>
> We were testing our PCRF implementation using the diameter stack and found
> that DWRs did not have a corresponding DWA.
> 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:
> http://tools.ietf.org/html/rfc3588#section-3) but a new locally generated
> one was being sent. Patch below fixes the problem.
>
>
> $ diff diameter_watchdog.erl ~/temp/diameter_watchdog.erl
> 465,468c465,479
> <     Seq = diameter_session:sequence(Mask),
> <     Hdr = #diameter_header{version = ?DIAMETER_VERSION,
> <                            end_to_end_id = Seq,
> <                            hop_by_hop_id = Seq},
> ---
>>     encode(undefined, Msg, Mask, Dict).
>>
>> encode(Req_pkt, Msg, Mask, Dict) ->
>>     Hdr = case Req_pkt of
>>               undefined ->
>>                   Seq = diameter_session:sequence(Mask),
>>                   #diameter_header{version = ?DIAMETER_VERSION,
>>                                    end_to_end_id = Seq,
>>                                    hop_by_hop_id = Seq};
>>               #diameter_packet{header = #diameter_header{hop_by_hop_id =
>> H2H,
>>                                                          end_to_end_id =
>> E2E}} ->
>>                   #diameter_header{version = ?DIAMETER_VERSION,
>>                                    end_to_end_id = E2E,
>>                                    hop_by_hop_id = H2H}
>>           end,
> 551c562
> <     send(TPid, {send, encode(dwa(Pkt), Mask, Dict0)}),
> ---
>>     send(TPid, {send, encode(Pkt, dwa(Pkt), Mask, Dict0)}),
> 795c806,808
> < dwa(#diameter_packet{header = H, errors = Es}) ->
> ---
>> dwa(#diameter_packet{header = #diameter_header{hop_by_hop_id = H2H,
>>                                                end_to_end_id = E2E} = H,
>>                      errors = Es}) ->
>
>
> best wishes,
> Sharmila.
>
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list