-/* $OpenBSD: in.h,v 1.103 2014/04/20 09:30:56 henning Exp $ */
+/* $OpenBSD: in.h,v 1.104 2014/04/20 09:38:19 henning Exp $ */
/* $NetBSD: in.h,v 1.20 1996/02/13 23:41:47 christos Exp $ */
/*
#endif
#else
-/*
- * in_cksum_phdr:
- *
- * Compute significant parts of the IPv4 checksum pseudo-header
- * for use in a delayed TCP/UDP checksum calculation.
- *
- * Args:
- *
- * src Source IP address
- * dst Destination IP address
- * lenproto htons(proto-hdr-len + proto-number)
- */
-static __inline u_int16_t __attribute__((__unused__))
-in_cksum_phdr(u_int32_t src, u_int32_t dst, u_int32_t lenproto)
-{
- u_int32_t sum;
-
- sum = lenproto +
- (u_int16_t)(src >> 16) +
- (u_int16_t)(src /*& 0xffff*/) +
- (u_int16_t)(dst >> 16) +
- (u_int16_t)(dst /*& 0xffff*/);
-
- sum = (u_int16_t)(sum >> 16) + (u_int16_t)(sum /*& 0xffff*/);
-
- if (sum > 0xffff)
- sum -= 0xffff;
-
- return (sum);
-}
-
extern int inetctlerrmap[];
extern struct ifqueue ipintrq; /* ip packet input queue */
extern struct in_addr zeroin_addr;
-/* $OpenBSD: ip_output.c,v 1.261 2014/04/14 09:06:42 mpi Exp $ */
+/* $OpenBSD: ip_output.c,v 1.262 2014/04/20 09:38:19 henning Exp $ */
/* $NetBSD: ip_output.c,v 1.28 1996/02/13 23:43:07 christos Exp $ */
/*
struct mbuf *ip_insertoptions(struct mbuf *, struct mbuf *, int *);
void ip_mloopback(struct ifnet *, struct mbuf *, struct sockaddr_in *);
+static __inline u_int16_t __attribute__((__unused__))
+ in_cksum_phdr(u_int32_t, u_int32_t, u_int32_t);
void in_delayed_cksum(struct mbuf *);
/*
}
}
+/*
+ * Compute significant parts of the IPv4 checksum pseudo-header
+ * for use in a delayed TCP/UDP checksum calculation.
+ */
+static __inline u_int16_t __attribute__((__unused__))
+in_cksum_phdr(u_int32_t src, u_int32_t dst, u_int32_t lenproto)
+{
+ u_int32_t sum;
+
+ sum = lenproto +
+ (u_int16_t)(src >> 16) +
+ (u_int16_t)(src /*& 0xffff*/) +
+ (u_int16_t)(dst >> 16) +
+ (u_int16_t)(dst /*& 0xffff*/);
+
+ sum = (u_int16_t)(sum >> 16) + (u_int16_t)(sum /*& 0xffff*/);
+
+ if (sum > 0xffff)
+ sum -= 0xffff;
+
+ return (sum);
+}
+
/*
* Process a delayed payload checksum calculation.
*/