diff options
Diffstat (limited to 'net/decnet/dn_nsp_in.c')
-rw-r--r-- | net/decnet/dn_nsp_in.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/net/decnet/dn_nsp_in.c b/net/decnet/dn_nsp_in.c index 44bda85e678f..547523b41c81 100644 --- a/net/decnet/dn_nsp_in.c +++ b/net/decnet/dn_nsp_in.c | |||
@@ -85,7 +85,7 @@ static void dn_log_martian(struct sk_buff *skb, const char *msg) | |||
85 | if (decnet_log_martians && net_ratelimit()) { | 85 | if (decnet_log_martians && net_ratelimit()) { |
86 | char *devname = skb->dev ? skb->dev->name : "???"; | 86 | char *devname = skb->dev ? skb->dev->name : "???"; |
87 | struct dn_skb_cb *cb = DN_SKB_CB(skb); | 87 | struct dn_skb_cb *cb = DN_SKB_CB(skb); |
88 | printk(KERN_INFO "DECnet: Martian packet (%s) dev=%s src=0x%04hx dst=0x%04hx srcport=0x%04hx dstport=0x%04hx\n", msg, devname, cb->src, cb->dst, cb->src_port, cb->dst_port); | 88 | printk(KERN_INFO "DECnet: Martian packet (%s) dev=%s src=0x%04hx dst=0x%04hx srcport=0x%04hx dstport=0x%04hx\n", msg, devname, dn_ntohs(cb->src), dn_ntohs(cb->dst), dn_ntohs(cb->src_port), dn_ntohs(cb->dst_port)); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | 91 | ||
@@ -128,7 +128,7 @@ static void dn_ack(struct sock *sk, struct sk_buff *skb, unsigned short ack) | |||
128 | */ | 128 | */ |
129 | static int dn_process_ack(struct sock *sk, struct sk_buff *skb, int oth) | 129 | static int dn_process_ack(struct sock *sk, struct sk_buff *skb, int oth) |
130 | { | 130 | { |
131 | unsigned short *ptr = (unsigned short *)skb->data; | 131 | __le16 *ptr = (__le16 *)skb->data; |
132 | int len = 0; | 132 | int len = 0; |
133 | unsigned short ack; | 133 | unsigned short ack; |
134 | 134 | ||
@@ -346,7 +346,7 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb) | |||
346 | ptr = skb->data; | 346 | ptr = skb->data; |
347 | cb->services = *ptr++; | 347 | cb->services = *ptr++; |
348 | cb->info = *ptr++; | 348 | cb->info = *ptr++; |
349 | cb->segsize = dn_ntohs(*(__u16 *)ptr); | 349 | cb->segsize = dn_ntohs(*(__le16 *)ptr); |
350 | 350 | ||
351 | if ((scp->state == DN_CI) || (scp->state == DN_CD)) { | 351 | if ((scp->state == DN_CI) || (scp->state == DN_CD)) { |
352 | scp->persist = 0; | 352 | scp->persist = 0; |
@@ -363,7 +363,7 @@ static void dn_nsp_conn_conf(struct sock *sk, struct sk_buff *skb) | |||
363 | if (skb->len > 0) { | 363 | if (skb->len > 0) { |
364 | unsigned char dlen = *skb->data; | 364 | unsigned char dlen = *skb->data; |
365 | if ((dlen <= 16) && (dlen <= skb->len)) { | 365 | if ((dlen <= 16) && (dlen <= skb->len)) { |
366 | scp->conndata_in.opt_optl = dlen; | 366 | scp->conndata_in.opt_optl = dn_htons((__u16)dlen); |
367 | memcpy(scp->conndata_in.opt_data, skb->data + 1, dlen); | 367 | memcpy(scp->conndata_in.opt_data, skb->data + 1, dlen); |
368 | } | 368 | } |
369 | } | 369 | } |
@@ -397,17 +397,17 @@ static void dn_nsp_disc_init(struct sock *sk, struct sk_buff *skb) | |||
397 | if (skb->len < 2) | 397 | if (skb->len < 2) |
398 | goto out; | 398 | goto out; |
399 | 399 | ||
400 | reason = dn_ntohs(*(__u16 *)skb->data); | 400 | reason = dn_ntohs(*(__le16 *)skb->data); |
401 | skb_pull(skb, 2); | 401 | skb_pull(skb, 2); |
402 | 402 | ||
403 | scp->discdata_in.opt_status = reason; | 403 | scp->discdata_in.opt_status = dn_htons(reason); |
404 | scp->discdata_in.opt_optl = 0; | 404 | scp->discdata_in.opt_optl = 0; |
405 | memset(scp->discdata_in.opt_data, 0, 16); | 405 | memset(scp->discdata_in.opt_data, 0, 16); |
406 | 406 | ||
407 | if (skb->len > 0) { | 407 | if (skb->len > 0) { |
408 | unsigned char dlen = *skb->data; | 408 | unsigned char dlen = *skb->data; |
409 | if ((dlen <= 16) && (dlen <= skb->len)) { | 409 | if ((dlen <= 16) && (dlen <= skb->len)) { |
410 | scp->discdata_in.opt_optl = dlen; | 410 | scp->discdata_in.opt_optl = dn_htons((__u16)dlen); |
411 | memcpy(scp->discdata_in.opt_data, skb->data + 1, dlen); | 411 | memcpy(scp->discdata_in.opt_data, skb->data + 1, dlen); |
412 | } | 412 | } |
413 | } | 413 | } |
@@ -464,7 +464,7 @@ static void dn_nsp_disc_conf(struct sock *sk, struct sk_buff *skb) | |||
464 | if (skb->len != 2) | 464 | if (skb->len != 2) |
465 | goto out; | 465 | goto out; |
466 | 466 | ||
467 | reason = dn_ntohs(*(__u16 *)skb->data); | 467 | reason = dn_ntohs(*(__le16 *)skb->data); |
468 | 468 | ||
469 | sk->sk_state = TCP_CLOSE; | 469 | sk->sk_state = TCP_CLOSE; |
470 | 470 | ||
@@ -513,7 +513,7 @@ static void dn_nsp_linkservice(struct sock *sk, struct sk_buff *skb) | |||
513 | if (skb->len != 4) | 513 | if (skb->len != 4) |
514 | goto out; | 514 | goto out; |
515 | 515 | ||
516 | segnum = dn_ntohs(*(__u16 *)ptr); | 516 | segnum = dn_ntohs(*(__le16 *)ptr); |
517 | ptr += 2; | 517 | ptr += 2; |
518 | lsflags = *(unsigned char *)ptr++; | 518 | lsflags = *(unsigned char *)ptr++; |
519 | fcval = *ptr; | 519 | fcval = *ptr; |
@@ -621,7 +621,7 @@ static void dn_nsp_otherdata(struct sock *sk, struct sk_buff *skb) | |||
621 | if (skb->len < 2) | 621 | if (skb->len < 2) |
622 | goto out; | 622 | goto out; |
623 | 623 | ||
624 | cb->segnum = segnum = dn_ntohs(*(__u16 *)skb->data); | 624 | cb->segnum = segnum = dn_ntohs(*(__le16 *)skb->data); |
625 | skb_pull(skb, 2); | 625 | skb_pull(skb, 2); |
626 | 626 | ||
627 | if (seq_next(scp->numoth_rcv, segnum)) { | 627 | if (seq_next(scp->numoth_rcv, segnum)) { |
@@ -649,7 +649,7 @@ static void dn_nsp_data(struct sock *sk, struct sk_buff *skb) | |||
649 | if (skb->len < 2) | 649 | if (skb->len < 2) |
650 | goto out; | 650 | goto out; |
651 | 651 | ||
652 | cb->segnum = segnum = dn_ntohs(*(__u16 *)skb->data); | 652 | cb->segnum = segnum = dn_ntohs(*(__le16 *)skb->data); |
653 | skb_pull(skb, 2); | 653 | skb_pull(skb, 2); |
654 | 654 | ||
655 | if (seq_next(scp->numdat_rcv, segnum)) { | 655 | if (seq_next(scp->numdat_rcv, segnum)) { |
@@ -760,7 +760,7 @@ static int dn_nsp_rx_packet(struct sk_buff *skb) | |||
760 | /* | 760 | /* |
761 | * Grab the destination address. | 761 | * Grab the destination address. |
762 | */ | 762 | */ |
763 | cb->dst_port = *(unsigned short *)ptr; | 763 | cb->dst_port = *(__le16 *)ptr; |
764 | cb->src_port = 0; | 764 | cb->src_port = 0; |
765 | ptr += 2; | 765 | ptr += 2; |
766 | 766 | ||
@@ -768,7 +768,7 @@ static int dn_nsp_rx_packet(struct sk_buff *skb) | |||
768 | * If not a connack, grab the source address too. | 768 | * If not a connack, grab the source address too. |
769 | */ | 769 | */ |
770 | if (pskb_may_pull(skb, 5)) { | 770 | if (pskb_may_pull(skb, 5)) { |
771 | cb->src_port = *(unsigned short *)ptr; | 771 | cb->src_port = *(__le16 *)ptr; |
772 | ptr += 2; | 772 | ptr += 2; |
773 | skb_pull(skb, 5); | 773 | skb_pull(skb, 5); |
774 | } | 774 | } |
@@ -778,7 +778,7 @@ static int dn_nsp_rx_packet(struct sk_buff *skb) | |||
778 | * Swap src & dst and look up in the normal way. | 778 | * Swap src & dst and look up in the normal way. |
779 | */ | 779 | */ |
780 | if (unlikely(cb->rt_flags & DN_RT_F_RTS)) { | 780 | if (unlikely(cb->rt_flags & DN_RT_F_RTS)) { |
781 | unsigned short tmp = cb->dst_port; | 781 | __le16 tmp = cb->dst_port; |
782 | cb->dst_port = cb->src_port; | 782 | cb->dst_port = cb->src_port; |
783 | cb->src_port = tmp; | 783 | cb->src_port = tmp; |
784 | tmp = cb->dst; | 784 | tmp = cb->dst; |