aboutsummaryrefslogtreecommitdiffstats
path: root/net/decnet/dn_nsp_out.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/decnet/dn_nsp_out.c')
-rw-r--r--net/decnet/dn_nsp_out.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/net/decnet/dn_nsp_out.c b/net/decnet/dn_nsp_out.c
index c96c767b1f74..c2e21cd89b3c 100644
--- a/net/decnet/dn_nsp_out.c
+++ b/net/decnet/dn_nsp_out.c
@@ -287,26 +287,26 @@ int dn_nsp_xmit_timeout(struct sock *sk)
287 return 0; 287 return 0;
288} 288}
289 289
290static inline unsigned char *dn_mk_common_header(struct dn_scp *scp, struct sk_buff *skb, unsigned char msgflag, int len) 290static inline __le16 *dn_mk_common_header(struct dn_scp *scp, struct sk_buff *skb, unsigned char msgflag, int len)
291{ 291{
292 unsigned char *ptr = skb_push(skb, len); 292 unsigned char *ptr = skb_push(skb, len);
293 293
294 BUG_ON(len < 5); 294 BUG_ON(len < 5);
295 295
296 *ptr++ = msgflag; 296 *ptr++ = msgflag;
297 *((unsigned short *)ptr) = scp->addrrem; 297 *((__le16 *)ptr) = scp->addrrem;
298 ptr += 2; 298 ptr += 2;
299 *((unsigned short *)ptr) = scp->addrloc; 299 *((__le16 *)ptr) = scp->addrloc;
300 ptr += 2; 300 ptr += 2;
301 return ptr; 301 return (__le16 __force *)ptr;
302} 302}
303 303
304static unsigned short *dn_mk_ack_header(struct sock *sk, struct sk_buff *skb, unsigned char msgflag, int hlen, int other) 304static __le16 *dn_mk_ack_header(struct sock *sk, struct sk_buff *skb, unsigned char msgflag, int hlen, int other)
305{ 305{
306 struct dn_scp *scp = DN_SK(sk); 306 struct dn_scp *scp = DN_SK(sk);
307 unsigned short acknum = scp->numdat_rcv & 0x0FFF; 307 unsigned short acknum = scp->numdat_rcv & 0x0FFF;
308 unsigned short ackcrs = scp->numoth_rcv & 0x0FFF; 308 unsigned short ackcrs = scp->numoth_rcv & 0x0FFF;
309 unsigned short *ptr; 309 __le16 *ptr;
310 310
311 BUG_ON(hlen < 9); 311 BUG_ON(hlen < 9);
312 312
@@ -325,7 +325,7 @@ static unsigned short *dn_mk_ack_header(struct sock *sk, struct sk_buff *skb, un
325 /* Set "cross subchannel" bit in ackcrs */ 325 /* Set "cross subchannel" bit in ackcrs */
326 ackcrs |= 0x2000; 326 ackcrs |= 0x2000;
327 327
328 ptr = (unsigned short *)dn_mk_common_header(scp, skb, msgflag, hlen); 328 ptr = (__le16 *)dn_mk_common_header(scp, skb, msgflag, hlen);
329 329
330 *ptr++ = dn_htons(acknum); 330 *ptr++ = dn_htons(acknum);
331 *ptr++ = dn_htons(ackcrs); 331 *ptr++ = dn_htons(ackcrs);
@@ -333,11 +333,11 @@ static unsigned short *dn_mk_ack_header(struct sock *sk, struct sk_buff *skb, un
333 return ptr; 333 return ptr;
334} 334}
335 335
336static unsigned short *dn_nsp_mk_data_header(struct sock *sk, struct sk_buff *skb, int oth) 336static __le16 *dn_nsp_mk_data_header(struct sock *sk, struct sk_buff *skb, int oth)
337{ 337{
338 struct dn_scp *scp = DN_SK(sk); 338 struct dn_scp *scp = DN_SK(sk);
339 struct dn_skb_cb *cb = DN_SKB_CB(skb); 339 struct dn_skb_cb *cb = DN_SKB_CB(skb);
340 unsigned short *ptr = dn_mk_ack_header(sk, skb, cb->nsp_flags, 11, oth); 340 __le16 *ptr = dn_mk_ack_header(sk, skb, cb->nsp_flags, 11, oth);
341 341
342 if (unlikely(oth)) { 342 if (unlikely(oth)) {
343 cb->segnum = scp->numoth; 343 cb->segnum = scp->numoth;
@@ -524,9 +524,9 @@ void dn_send_conn_conf(struct sock *sk, gfp_t gfp)
524 struct dn_scp *scp = DN_SK(sk); 524 struct dn_scp *scp = DN_SK(sk);
525 struct sk_buff *skb = NULL; 525 struct sk_buff *skb = NULL;
526 struct nsp_conn_init_msg *msg; 526 struct nsp_conn_init_msg *msg;
527 unsigned char len = scp->conndata_out.opt_optl; 527 __u8 len = (__u8)dn_ntohs(scp->conndata_out.opt_optl);
528 528
529 if ((skb = dn_alloc_skb(sk, 50 + scp->conndata_out.opt_optl, gfp)) == NULL) 529 if ((skb = dn_alloc_skb(sk, 50 + dn_ntohs(scp->conndata_out.opt_optl), gfp)) == NULL)
530 return; 530 return;
531 531
532 msg = (struct nsp_conn_init_msg *)skb_put(skb, sizeof(*msg)); 532 msg = (struct nsp_conn_init_msg *)skb_put(skb, sizeof(*msg));
@@ -553,7 +553,7 @@ void dn_send_conn_conf(struct sock *sk, gfp_t gfp)
553static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg, 553static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg,
554 unsigned short reason, gfp_t gfp, 554 unsigned short reason, gfp_t gfp,
555 struct dst_entry *dst, 555 struct dst_entry *dst,
556 int ddl, unsigned char *dd, __u16 rem, __u16 loc) 556 int ddl, unsigned char *dd, __le16 rem, __le16 loc)
557{ 557{
558 struct sk_buff *skb = NULL; 558 struct sk_buff *skb = NULL;
559 int size = 7 + ddl + ((msgflg == NSP_DISCINIT) ? 1 : 0); 559 int size = 7 + ddl + ((msgflg == NSP_DISCINIT) ? 1 : 0);
@@ -561,7 +561,7 @@ static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg,
561 561
562 if ((dst == NULL) || (rem == 0)) { 562 if ((dst == NULL) || (rem == 0)) {
563 if (net_ratelimit()) 563 if (net_ratelimit())
564 printk(KERN_DEBUG "DECnet: dn_nsp_do_disc: BUG! Please report this to SteveW@ACM.org rem=%u dst=%p\n", (unsigned)rem, dst); 564 printk(KERN_DEBUG "DECnet: dn_nsp_do_disc: BUG! Please report this to SteveW@ACM.org rem=%u dst=%p\n", dn_ntohs(rem), dst);
565 return; 565 return;
566 } 566 }
567 567
@@ -570,11 +570,11 @@ static __inline__ void dn_nsp_do_disc(struct sock *sk, unsigned char msgflg,
570 570
571 msg = skb_put(skb, size); 571 msg = skb_put(skb, size);
572 *msg++ = msgflg; 572 *msg++ = msgflg;
573 *(__u16 *)msg = rem; 573 *(__le16 *)msg = rem;
574 msg += 2; 574 msg += 2;
575 *(__u16 *)msg = loc; 575 *(__le16 *)msg = loc;
576 msg += 2; 576 msg += 2;
577 *(__u16 *)msg = dn_htons(reason); 577 *(__le16 *)msg = dn_htons(reason);
578 msg += 2; 578 msg += 2;
579 if (msgflg == NSP_DISCINIT) 579 if (msgflg == NSP_DISCINIT)
580 *msg++ = ddl; 580 *msg++ = ddl;
@@ -600,10 +600,10 @@ void dn_nsp_send_disc(struct sock *sk, unsigned char msgflg,
600 int ddl = 0; 600 int ddl = 0;
601 601
602 if (msgflg == NSP_DISCINIT) 602 if (msgflg == NSP_DISCINIT)
603 ddl = scp->discdata_out.opt_optl; 603 ddl = dn_ntohs(scp->discdata_out.opt_optl);
604 604
605 if (reason == 0) 605 if (reason == 0)
606 reason = scp->discdata_out.opt_status; 606 reason = dn_ntohs(scp->discdata_out.opt_status);
607 607
608 dn_nsp_do_disc(sk, msgflg, reason, gfp, sk->sk_dst_cache, ddl, 608 dn_nsp_do_disc(sk, msgflg, reason, gfp, sk->sk_dst_cache, ddl,
609 scp->discdata_out.opt_data, scp->addrrem, scp->addrloc); 609 scp->discdata_out.opt_data, scp->addrrem, scp->addrloc);
@@ -708,7 +708,7 @@ void dn_nsp_send_conninit(struct sock *sk, unsigned char msgflg)
708 if (aux > 0) 708 if (aux > 0)
709 memcpy(skb_put(skb, aux), scp->accessdata.acc_acc, aux); 709 memcpy(skb_put(skb, aux), scp->accessdata.acc_acc, aux);
710 710
711 aux = scp->conndata_out.opt_optl; 711 aux = (__u8)dn_ntohs(scp->conndata_out.opt_optl);
712 *skb_put(skb, 1) = aux; 712 *skb_put(skb, 1) = aux;
713 if (aux > 0) 713 if (aux > 0)
714 memcpy(skb_put(skb,aux), scp->conndata_out.opt_data, aux); 714 memcpy(skb_put(skb,aux), scp->conndata_out.opt_data, aux);