@@ -106,7 +106,7 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb)
106
106
priv -> stats .rx_frame_errors ++ ;
107
107
return ;
108
108
}
109
- pskb -> protocol = ntohs (header -> type );
109
+ pskb -> protocol = cpu_to_be16 (header -> type );
110
110
if ((header -> length <= LL_HEADER_LENGTH ) ||
111
111
(len <= LL_HEADER_LENGTH )) {
112
112
if (!(ch -> logflags & LOG_FLAG_ILLEGALSIZE )) {
@@ -125,7 +125,7 @@ void ctcm_unpack_skb(struct channel *ch, struct sk_buff *pskb)
125
125
header -> length -= LL_HEADER_LENGTH ;
126
126
len -= LL_HEADER_LENGTH ;
127
127
if ((header -> length > skb_tailroom (pskb )) ||
128
- (header -> length > len )) {
128
+ (header -> length > len )) {
129
129
if (!(ch -> logflags & LOG_FLAG_OVERRUN )) {
130
130
CTCM_DBF_TEXT_ (ERROR , CTC_DBF_ERROR ,
131
131
"%s(%s): Packet size %d (overrun)"
@@ -485,7 +485,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
485
485
} else {
486
486
atomic_inc (& skb -> users );
487
487
header .length = l ;
488
- header .type = skb -> protocol ;
488
+ header .type = be16_to_cpu ( skb -> protocol ) ;
489
489
header .unused = 0 ;
490
490
memcpy (skb_push (skb , LL_HEADER_LENGTH ), & header ,
491
491
LL_HEADER_LENGTH );
@@ -503,7 +503,7 @@ static int ctcm_transmit_skb(struct channel *ch, struct sk_buff *skb)
503
503
atomic_inc (& skb -> users );
504
504
ch -> prof .txlen += skb -> len ;
505
505
header .length = skb -> len + LL_HEADER_LENGTH ;
506
- header .type = skb -> protocol ;
506
+ header .type = be16_to_cpu ( skb -> protocol ) ;
507
507
header .unused = 0 ;
508
508
memcpy (skb_push (skb , LL_HEADER_LENGTH ), & header , LL_HEADER_LENGTH );
509
509
block_len = skb -> len + 2 ;
@@ -690,7 +690,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
690
690
p_header -> pdu_offset = skb -> len ;
691
691
p_header -> pdu_proto = 0x01 ;
692
692
p_header -> pdu_flag = 0x00 ;
693
- if (skb -> protocol == ntohs ( ETH_P_SNAP ) ) {
693
+ if (be16_to_cpu ( skb -> protocol ) == ETH_P_SNAP ) {
694
694
p_header -> pdu_flag |= PDU_FIRST | PDU_CNTL ;
695
695
} else {
696
696
p_header -> pdu_flag |= PDU_FIRST ;
@@ -745,7 +745,7 @@ static int ctcmpc_transmit_skb(struct channel *ch, struct sk_buff *skb)
745
745
p_header -> pdu_proto = 0x01 ;
746
746
p_header -> pdu_flag = 0x00 ;
747
747
p_header -> pdu_seq = 0 ;
748
- if (skb -> protocol == ntohs ( ETH_P_SNAP ) ) {
748
+ if (be16_to_cpu ( skb -> protocol ) == ETH_P_SNAP ) {
749
749
p_header -> pdu_flag |= PDU_FIRST | PDU_CNTL ;
750
750
} else {
751
751
p_header -> pdu_flag |= PDU_FIRST ;
0 commit comments