aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ppp_generic.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 19:32:41 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-11 19:32:41 -0500
commit4162cf64973df51fc885825bc9ca4d055891c49f (patch)
treef218c7bd298f4d41be94d08a314eb9fbc3fcb4ea /drivers/net/ppp_generic.c
parentfb7b5a956992fdc53d0b9c8ea29b51b92839dc1b (diff)
parent343a8d13aae58dec562dbb5c7d48a53e9b847871 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (67 commits) cxgb4vf: recover from failure in cxgb4vf_open() netfilter: ebtables: make broute table work again netfilter: fix race in conntrack between dump_table and destroy ah: reload pointers to skb data after calling skb_cow_data() ah: update maximum truncated ICV length xfrm: check trunc_len in XFRMA_ALG_AUTH_TRUNC ehea: Increase the skb array usage net/fec: remove config FEC2 as it's used nowhere pcnet_cs: add new_id tcp: disallow bind() to reuse addr/port net/r8169: Update the function of parsing firmware net: ppp: use {get,put}_unaligned_be{16,32} CAIF: Fix IPv6 support in receive path for GPRS/3G arp: allow to invalidate specific ARP entries net_sched: factorize qdisc stats handling mlx4: Call alloc_etherdev to allocate RX and TX queues net: Add alloc_netdev_mqs function caif: don't set connection request param size before copying data cxgb4vf: fix mailbox data/control coherency domain race qlcnic: change module parameter permissions ...
Diffstat (limited to 'drivers/net/ppp_generic.c')
-rw-r--r--drivers/net/ppp_generic.c9
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;