netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* checksum calculation in ip packet forwarding
@ 2005-01-30 13:09 cranium 2003
  0 siblings, 0 replies; only message in thread
From: cranium 2003 @ 2005-01-30 13:09 UTC (permalink / raw)
  To: netdev

Hello,
1) How Router knows destinations mtu. In IP forwarding case following
function is used that checks pmtu value to decide whether outgoing
packet is required to fragment a packet or not?
static inline int ip_send(struct sk_buff *skb)
{
	if (skb->len > skb->dst->pmtu)
		return ip_fragment(skb, ip_finish_output);
	else
		return ip_finish_output(skb);
}

2) Can anybody help me how following function works in calcualting checksum?
static inline int ip_decrease_ttl(struct iphdr *iph)
{
	u32 check = iph->check;
	check += __constant_htons(0x0100);
	iph->check = check + (check>=0xFFFF);
	return --iph->ttl;
}
regards,
cranium

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-01-30 13:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-30 13:09 checksum calculation in ip packet forwarding cranium 2003

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).