Lines Matching defs:sum
161 int32_t sum;
178 sum = ~ntohs(ip->ip_sum) & 0xffff;
179 sum += 0xff00 + (~old & 0xff) + dsfield;
180 sum = (sum >> 16) + (sum & 0xffff);
181 sum += (sum >> 16); /* add carry */
183 ip->ip_sum = htons(~sum & 0xffff);
241 int sum;
264 sum = ~ntohs(ip->ip_sum) & 0xffff;
265 sum += (~otos & 0xffff) + ip->ip_tos;
266 sum = (sum >> 16) + (sum & 0xffff);
267 sum += (sum >> 16); /* add carry */
268 ip->ip_sum = htons(~sum & 0xffff);