* re: GRE: Refactor GRE tunneling code.
@ 2013-04-02 6:34 Dan Carpenter
2013-04-02 7:44 ` Michal Kubecek
0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2013-04-02 6:34 UTC (permalink / raw)
To: pshelar; +Cc: netdev
Hi Pravin,
I had a question about c54419321455: "GRE: Refactor GRE tunneling code."
from Mar 25, 2013:
net/ipv4/ip_gre.c
392 if (tpi->flags&TUNNEL_CSUM &&
393 !(skb_shinfo(skb)->gso_type & SKB_GSO_GRE)) {
394 *(__sum16 *)ptr = 0;
395 *(__sum16 *)ptr = csum_fold(skb_checksum(skb, 0,
396 skb->len, 0));
What are we doing here when we set *ptr = 0 and then reset it on the
next line? Is there a ptr++ or ptr-- missing?
397 }
regards,
dan carpenter
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: GRE: Refactor GRE tunneling code.
2013-04-02 6:34 GRE: Refactor GRE tunneling code Dan Carpenter
@ 2013-04-02 7:44 ` Michal Kubecek
0 siblings, 0 replies; 2+ messages in thread
From: Michal Kubecek @ 2013-04-02 7:44 UTC (permalink / raw)
To: Dan Carpenter; +Cc: pshelar, netdev
On Tue, Apr 02, 2013 at 09:34:21AM +0300, Dan Carpenter wrote:
>
> I had a question about c54419321455: "GRE: Refactor GRE tunneling code."
> from Mar 25, 2013:
>
> net/ipv4/ip_gre.c
> 392 if (tpi->flags&TUNNEL_CSUM &&
> 393 !(skb_shinfo(skb)->gso_type & SKB_GSO_GRE)) {
> 394 *(__sum16 *)ptr = 0;
> 395 *(__sum16 *)ptr = csum_fold(skb_checksum(skb, 0,
> 396 skb->len, 0));
>
> What are we doing here when we set *ptr = 0 and then reset it on the
> next line? Is there a ptr++ or ptr-- missing?
AFAICS, skb_checksum() calculates the checksum over a block containing
the checksum field the result is to be written into (which is where ptr
points). This fields needs to be reset first.
Michal Kubecek
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-04-02 7:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-02 6:34 GRE: Refactor GRE tunneling code Dan Carpenter
2013-04-02 7:44 ` Michal Kubecek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox