Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2ca9e6f2c2a4117d21947e911ae1f5e5306b0df0
Commit:     2ca9e6f2c2a4117d21947e911ae1f5e5306b0df0
Parent:     31c7711b509d470ab1e175e7bb98ea66a82aa916
Author:     Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
AuthorDate: Sat Mar 10 19:15:25 2007 -0300
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:24:51 2007 -0700

    [SK_BUFF]: Some more skb_put cases converted to skb_reset_network_header
    
    Signed-off-by: Arnaldo Carvalho de Melo <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/ipv4/ip_output.c   |    3 ++-
 net/ipv4/ip_sockglue.c |    5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
index d329718..dde51fb 100644
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -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;
 
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index c5e4164..f8ab654 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to