diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-11 19:32:41 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-11 19:32:41 -0500 |
commit | 4162cf64973df51fc885825bc9ca4d055891c49f (patch) | |
tree | f218c7bd298f4d41be94d08a314eb9fbc3fcb4ea /drivers/net/ppp_async.c | |
parent | fb7b5a956992fdc53d0b9c8ea29b51b92839dc1b (diff) | |
parent | 343a8d13aae58dec562dbb5c7d48a53e9b847871 (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_async.c')
-rw-r--r-- | drivers/net/ppp_async.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c index 78d70a6481bf..a1b82c9c67d2 100644 --- a/drivers/net/ppp_async.c +++ b/drivers/net/ppp_async.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/init.h> | 32 | #include <linux/init.h> |
33 | #include <linux/jiffies.h> | 33 | #include <linux/jiffies.h> |
34 | #include <linux/slab.h> | 34 | #include <linux/slab.h> |
35 | #include <asm/unaligned.h> | ||
35 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
36 | #include <asm/string.h> | 37 | #include <asm/string.h> |
37 | 38 | ||
@@ -542,7 +543,7 @@ ppp_async_encode(struct asyncppp *ap) | |||
542 | data = ap->tpkt->data; | 543 | data = ap->tpkt->data; |
543 | count = ap->tpkt->len; | 544 | count = ap->tpkt->len; |
544 | fcs = ap->tfcs; | 545 | fcs = ap->tfcs; |
545 | proto = (data[0] << 8) + data[1]; | 546 | proto = get_unaligned_be16(data); |
546 | 547 | ||
547 | /* | 548 | /* |
548 | * LCP packets with code values between 1 (configure-reqest) | 549 | * LCP packets with code values between 1 (configure-reqest) |
@@ -963,7 +964,7 @@ static void async_lcp_peek(struct asyncppp *ap, unsigned char *data, | |||
963 | code = data[0]; | 964 | code = data[0]; |
964 | if (code != CONFACK && code != CONFREQ) | 965 | if (code != CONFACK && code != CONFREQ) |
965 | return; | 966 | return; |
966 | dlen = (data[2] << 8) + data[3]; | 967 | dlen = get_unaligned_be16(data + 2); |
967 | if (len < dlen) | 968 | if (len < dlen) |
968 | return; /* packet got truncated or length is bogus */ | 969 | return; /* packet got truncated or length is bogus */ |
969 | 970 | ||
@@ -997,15 +998,14 @@ static void async_lcp_peek(struct asyncppp *ap, unsigned char *data, | |||
997 | while (dlen >= 2 && dlen >= data[1] && data[1] >= 2) { | 998 | while (dlen >= 2 && dlen >= data[1] && data[1] >= 2) { |
998 | switch (data[0]) { | 999 | switch (data[0]) { |
999 | case LCP_MRU: | 1000 | case LCP_MRU: |
1000 | val = (data[2] << 8) + data[3]; | 1001 | val = get_unaligned_be16(data + 2); |
1001 | if (inbound) | 1002 | if (inbound) |
1002 | ap->mru = val; | 1003 | ap->mru = val; |
1003 | else | 1004 | else |
1004 | ap->chan.mtu = val; | 1005 | ap->chan.mtu = val; |
1005 | break; | 1006 | break; |
1006 | case LCP_ASYNCMAP: | 1007 | case LCP_ASYNCMAP: |
1007 | val = (data[2] << 24) + (data[3] << 16) | 1008 | val = get_unaligned_be32(data + 2); |
1008 | + (data[4] << 8) + data[5]; | ||
1009 | if (inbound) | 1009 | if (inbound) |
1010 | ap->raccm = val; | 1010 | ap->raccm = val; |
1011 | else | 1011 | else |