[SK_BUFF]: Some more skb_put cases converted to skb_reset_network_header
authorArnaldo Carvalho de Melo <acme@redhat.com>
Sat, 10 Mar 2007 22:15:25 +0000 (19:15 -0300)
committerDavid S. Miller <davem@sunset.davemloft.net>
Thu, 26 Apr 2007 05:24:51 +0000 (22:24 -0700)
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/ip_output.c
net/ipv4/ip_sockglue.c

index d329718a8e8cb2985d9e98d8c2ed6d1c512fafcd..dde51fb72cda616de3a4544fda9acd9bfd1d895c 100644 (file)
@@ -1126,7 +1126,8 @@ ssize_t   ip_append_page(struct sock *sk, struct page *page,
                         *      Find where to start putting bytes.
                         */
                        data = skb_put(skb, fragheaderlen + fraggap);
-                       skb->nh.iph = iph = (struct iphdr *)data;
+                       skb_reset_network_header(skb);
+                       iph = skb->nh.iph;
                        data += fragheaderlen;
                        skb->h.raw = data;
 
index c5e41644c80d248e28636a62788a87103ef2e94d..f8ab654b6a35de9a762a3e301646a2183aa7af64 100644 (file)
@@ -296,8 +296,9 @@ void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 port, u32 inf
        if (!skb)
                return;
 
-       iph = (struct iphdr*)skb_put(skb, sizeof(struct iphdr));
-       skb->nh.iph = iph;
+       skb_put(skb, sizeof(struct iphdr));
+       skb_reset_network_header(skb);
+       iph = skb->nh.iph;
        iph->daddr = daddr;
 
        serr = SKB_EXT_ERR(skb);