Commit 63de08f4 authored by Al Viro's avatar Al Viro Committed by David S. Miller

[SCTP]: Switch address inside the heartbeat opaque data to net-endian.

Its only use happens on the same host, when it gets quoted back to
us.  So we are free to flip to net-endian and avoid extra PITA.
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent be29681e
...@@ -852,7 +852,7 @@ static sctp_disposition_t sctp_sf_heartbeat(const struct sctp_endpoint *ep, ...@@ -852,7 +852,7 @@ static sctp_disposition_t sctp_sf_heartbeat(const struct sctp_endpoint *ep,
hbinfo.param_hdr.type = SCTP_PARAM_HEARTBEAT_INFO; hbinfo.param_hdr.type = SCTP_PARAM_HEARTBEAT_INFO;
hbinfo.param_hdr.length = htons(sizeof(sctp_sender_hb_info_t)); hbinfo.param_hdr.length = htons(sizeof(sctp_sender_hb_info_t));
hbinfo.daddr = transport->ipaddr_h; hbinfo.daddr = transport->ipaddr;
hbinfo.sent_at = jiffies; hbinfo.sent_at = jiffies;
hbinfo.hb_nonce = transport->hb_nonce; hbinfo.hb_nonce = transport->hb_nonce;
...@@ -1018,7 +1018,6 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, ...@@ -1018,7 +1018,6 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
struct sctp_transport *link; struct sctp_transport *link;
sctp_sender_hb_info_t *hbinfo; sctp_sender_hb_info_t *hbinfo;
unsigned long max_interval; unsigned long max_interval;
union sctp_addr tmp;
if (!sctp_vtag_verify(chunk, asoc)) if (!sctp_vtag_verify(chunk, asoc))
return sctp_sf_pdiscard(ep, asoc, type, arg, commands); return sctp_sf_pdiscard(ep, asoc, type, arg, commands);
...@@ -1036,8 +1035,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep, ...@@ -1036,8 +1035,7 @@ sctp_disposition_t sctp_sf_backbeat_8_3(const struct sctp_endpoint *ep,
} }
from_addr = hbinfo->daddr; from_addr = hbinfo->daddr;
flip_to_n(&tmp, &from_addr); link = sctp_assoc_lookup_paddr(asoc, &from_addr);
link = sctp_assoc_lookup_paddr(asoc, &tmp);
/* This should never happen, but lets log it if so. */ /* This should never happen, but lets log it if so. */
if (unlikely(!link)) { if (unlikely(!link)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment