diff options
-rw-r--r-- | net/ipv4/ip_output.c | 3 | ||||
-rw-r--r-- | 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 d329718a8e8c..dde51fb72cda 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, | |||
1126 | * Find where to start putting bytes. | 1126 | * Find where to start putting bytes. |
1127 | */ | 1127 | */ |
1128 | data = skb_put(skb, fragheaderlen + fraggap); | 1128 | data = skb_put(skb, fragheaderlen + fraggap); |
1129 | skb->nh.iph = iph = (struct iphdr *)data; | 1129 | skb_reset_network_header(skb); |
1130 | iph = skb->nh.iph; | ||
1130 | data += fragheaderlen; | 1131 | data += fragheaderlen; |
1131 | skb->h.raw = data; | 1132 | skb->h.raw = data; |
1132 | 1133 | ||
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index c5e41644c80d..f8ab654b6a35 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 | |||
296 | if (!skb) | 296 | if (!skb) |
297 | return; | 297 | return; |
298 | 298 | ||
299 | iph = (struct iphdr*)skb_put(skb, sizeof(struct iphdr)); | 299 | skb_put(skb, sizeof(struct iphdr)); |
300 | skb->nh.iph = iph; | 300 | skb_reset_network_header(skb); |
301 | iph = skb->nh.iph; | ||
301 | iph->daddr = daddr; | 302 | iph->daddr = daddr; |
302 | 303 | ||
303 | serr = SKB_EXT_ERR(skb); | 304 | serr = SKB_EXT_ERR(skb); |