Pull arp header before grabbing the pointer to it.
authorBen Pfaff <blp@nicira.com>
Thu, 13 Nov 2008 20:44:35 +0000 (12:44 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 13 Nov 2008 20:45:38 +0000 (12:45 -0800)
datapath/nx_act_snat.c

index 2d0306ad1ac1b8272487782ad24a564bf0e5316e..f846671f85fb0cefe2318d9c764ece311ada33de 100644 (file)
@@ -203,11 +203,12 @@ static int
 handle_arp_snat(struct sk_buff *skb)
 {
        struct net_bridge_port *p = skb->dev->br_port;
-       struct ip_arphdr *ah = (struct ip_arphdr *)arp_hdr(skb);
+       struct ip_arphdr *ah;
 
        if (!pskb_may_pull(skb, sizeof *ah))
                return 0;
 
+       ah = (struct ip_arphdr *)arp_hdr(skb);
        if ((ah->ar_op != htons(ARPOP_REQUEST)) 
                        || ah->ar_hln != ETH_ALEN
                        || ah->ar_pro != htons(ETH_P_IP)