diff options
author | Steven Whitehouse <swhiteho@redhat.com> | 2006-11-07 18:09:17 -0500 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-11-07 18:10:17 -0500 |
commit | 375d9d71838970030c8e0bf0ac2abcc1a3487df8 (patch) | |
tree | 8c4cb7363852c41ed873fd245d44c155c2b2bed9 /net/decnet/dn_nsp_in.c | |
parent | af2c6a4aaa2253f1e29df8fb59a3d92174d30a33 (diff) |
[DECNET]: Endianess fixes (try #2)
Here are some fixes to endianess problems spotted by Al Viro.
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/decnet/dn_nsp_in.c')
-rw-r--r-- | net/decnet/dn_nsp_in.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c index 72ecc6e62ec4..7683d4f754d2 100644 --- a/net/decnet/dn_nsp_in.c +++ b/net/decnet/dn_nsp_in.c | |||
@@ -360,9 +360,9 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb) | |||
360 | scp->max_window = decnet_no_fc_max_cwnd; | 360 | scp->max_window = decnet_no_fc_max_cwnd; |
361 | 361 | ||
362 | if (skb->len > 0) { | 362 | if (skb->len > 0) { |
363 | unsigned char dlen = *skb->data; | 363 | u16 dlen = *skb->data; |
364 | if ((dlen <= 16) && (dlen <= skb->len)) { | 364 | if ((dlen <= 16) && (dlen <= skb->len)) { |
365 | scp->conndata_in.opt_optl = dn_htons((__u16)dlen); | 365 | scp->conndata_in.opt_optl = dn_htons(dlen); |
366 | memcpy(scp->conndata_in.opt_data, skb->data + 1, dlen); | 366 | memcpy(scp->conndata_in.opt_data, skb->data + 1, dlen); |
367 | } | 367 | } |
368 | } | 368 | } |
@@ -404,9 +404,9 @@ static void dn_nsp_disc_init(struct sock *sk, struct sk_buff *skb) | |||
404 | memset(scp->discdata_in.opt_data, 0, 16); | 404 | memset(scp->discdata_in.opt_data, 0, 16); |
405 | 405 | ||
406 | if (skb->len > 0) { | 406 | if (skb->len > 0) { |
407 | unsigned char dlen = *skb->data; | 407 | u16 dlen = *skb->data; |
408 | if ((dlen <= 16) && (dlen <= skb->len)) { | 408 | if ((dlen <= 16) && (dlen <= skb->len)) { |
409 | scp->discdata_in.opt_optl = dn_htons((__u16)dlen); | 409 | scp->discdata_in.opt_optl = dn_htons(dlen); |
410 | memcpy(scp->discdata_in.opt_data, skb->data + 1, dlen); | 410 | memcpy(scp->discdata_in.opt_data, skb->data + 1, dlen); |
411 | } | 411 | } |
412 | } | 412 | } |