summaryrefslogtreecommitdiff
path: root/net/sctp/input.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-03-13 17:17:10 -0300
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-25 22:25:30 -0700
commita27ef749e7be3b06fb58df53d94eb97a21f18707 (patch)
tree8d9b4521b51393057988780a1297f7743005b5d2 /net/sctp/input.c
parentbd82393ca23324d103b21aae43160728da6e6c9c (diff)
[SCTP]: Eliminate some pointer attributions to the skb layer headers
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sctp/input.c')
-rw-r--r--net/sctp/input.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/sctp/input.c b/net/sctp/input.c
index 40d0df80183f..f38e91b38719 100644
--- a/net/sctp/input.c
+++ b/net/sctp/input.c
@@ -506,7 +506,7 @@ void sctp_err_finish(struct sock *sk, struct sctp_association *asoc)
void sctp_v4_err(struct sk_buff *skb, __u32 info)
{
struct iphdr *iph = (struct iphdr *)skb->data;
- struct sctphdr *sh = (struct sctphdr *)(skb->data + (iph->ihl <<2));
+ const int ihlen = iph->ihl * 4;
const int type = icmp_hdr(skb)->type;
const int code = icmp_hdr(skb)->code;
struct sock *sk;
@@ -516,7 +516,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
char *saveip, *savesctp;
int err;
- if (skb->len < ((iph->ihl << 2) + 8)) {
+ if (skb->len < ihlen + 8) {
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
return;
}
@@ -525,8 +525,8 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
saveip = skb->nh.raw;
savesctp = skb->h.raw;
skb_reset_network_header(skb);
- skb->h.raw = (char *)sh;
- sk = sctp_err_lookup(AF_INET, skb, sh, &asoc, &transport);
+ skb_set_transport_header(skb, ihlen);
+ sk = sctp_err_lookup(AF_INET, skb, sctp_hdr(skb), &asoc, &transport);
/* Put back, the original pointers. */
skb->nh.raw = saveip;
skb->h.raw = savesctp;