diff options
Diffstat (limited to 'drivers/net/ppp_generic.c')
-rw-r--r-- | drivers/net/ppp_generic.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c index 6456484c0299..c7a6c4466978 100644 --- a/drivers/net/ppp_generic.c +++ b/drivers/net/ppp_generic.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include <linux/device.h> | 46 | #include <linux/device.h> |
47 | #include <linux/mutex.h> | 47 | #include <linux/mutex.h> |
48 | #include <linux/slab.h> | 48 | #include <linux/slab.h> |
49 | #include <asm/unaligned.h> | ||
49 | #include <net/slhc_vj.h> | 50 | #include <net/slhc_vj.h> |
50 | #include <asm/atomic.h> | 51 | #include <asm/atomic.h> |
51 | 52 | ||
@@ -210,7 +211,7 @@ struct ppp_net { | |||
210 | }; | 211 | }; |
211 | 212 | ||
212 | /* Get the PPP protocol number from a skb */ | 213 | /* Get the PPP protocol number from a skb */ |
213 | #define PPP_PROTO(skb) (((skb)->data[0] << 8) + (skb)->data[1]) | 214 | #define PPP_PROTO(skb) get_unaligned_be16((skb)->data) |
214 | 215 | ||
215 | /* We limit the length of ppp->file.rq to this (arbitrary) value */ | 216 | /* We limit the length of ppp->file.rq to this (arbitrary) value */ |
216 | #define PPP_MAX_RQLEN 32 | 217 | #define PPP_MAX_RQLEN 32 |
@@ -964,8 +965,7 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
964 | 965 | ||
965 | pp = skb_push(skb, 2); | 966 | pp = skb_push(skb, 2); |
966 | proto = npindex_to_proto[npi]; | 967 | proto = npindex_to_proto[npi]; |
967 | pp[0] = proto >> 8; | 968 | put_unaligned_be16(proto, pp); |
968 | pp[1] = proto; | ||
969 | 969 | ||
970 | netif_stop_queue(dev); | 970 | netif_stop_queue(dev); |
971 | skb_queue_tail(&ppp->file.xq, skb); | 971 | skb_queue_tail(&ppp->file.xq, skb); |
@@ -1473,8 +1473,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb) | |||
1473 | q = skb_put(frag, flen + hdrlen); | 1473 | q = skb_put(frag, flen + hdrlen); |
1474 | 1474 | ||
1475 | /* make the MP header */ | 1475 | /* make the MP header */ |
1476 | q[0] = PPP_MP >> 8; | 1476 | put_unaligned_be16(PPP_MP, q); |
1477 | q[1] = PPP_MP; | ||
1478 | if (ppp->flags & SC_MP_XSHORTSEQ) { | 1477 | if (ppp->flags & SC_MP_XSHORTSEQ) { |
1479 | q[2] = bits + ((ppp->nxseq >> 8) & 0xf); | 1478 | q[2] = bits + ((ppp->nxseq >> 8) & 0xf); |
1480 | q[3] = ppp->nxseq; | 1479 | q[3] = ppp->nxseq; |