Linux kernel function

 

1. 由於是 iph->check 已是 one's complement 過後的狀態,所以 iph->check +=1 相當於是 ttl -1 。

2. 為了處理 ttl =0 是的情況, 也就是 iph->check = 0xffff ,ttl 不減,所以iph->check 做一些特殊處理。

3。目前沒有看到 ttl =0 時,ip_decrease_ttl 被使用的時候。

 

 

 

fu32 check = (__force u32)iph->check;
 222         check += (__force u32)htons(0x0100);
 223         iph->check = (__force __sum16)(check + (check>=0xFFFF));
 224         return --iph->ttl;
文章標籤
全站熱搜
創作者介紹
創作者 lettice0913 的頭像
lettice0913

斑的家

lettice0913 發表在 痞客邦 留言(1) 人氣(29)