From: Ben Pfaff Date: Thu, 13 Nov 2008 20:44:35 +0000 (-0800) Subject: Pull arp header before grabbing the pointer to it. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f1439fb8951760ee89f5c86effdd845696ad1a12;p=openvswitch Pull arp header before grabbing the pointer to it. --- diff --git a/datapath/nx_act_snat.c b/datapath/nx_act_snat.c index 2d0306ad..f846671f 100644 --- a/datapath/nx_act_snat.c +++ b/datapath/nx_act_snat.c @@ -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)