diff options
-rw-r--r-- | net/atm/mpc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/atm/mpc.c b/net/atm/mpc.c index c304ef1513b..c2d11fe3db1 100644 --- a/net/atm/mpc.c +++ b/net/atm/mpc.c @@ -552,6 +552,13 @@ static int mpc_send_packet(struct sk_buff *skb, struct net_device *dev) if (eth->h_proto != htons(ETH_P_IP)) goto non_ip; /* Multi-Protocol Over ATM :-) */ + /* Weed out funny packets (e.g., AF_PACKET or raw). */ + if (skb->len < ETH_HLEN + sizeof(struct iphdr)) + goto non_ip; + skb->nh.raw = skb->data + ETH_HLEN; + if (skb->len < ETH_HLEN + skb->nh.iph->ihl * 4 || skb->nh.iph->ihl < 5) + goto non_ip; + while (i < mpc->number_of_mps_macs) { if (!compare_ether_addr(eth->h_dest, (mpc->mps_macs + i*ETH_ALEN))) if ( send_via_shortcut(skb, mpc) == 0 ) /* try shortcut */ |