Date: Thu, 27 Nov 2008 13:17:10 GMT From: Marko Zec <zec@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 153666 for review Message-ID: <200811271317.mARDHAgC029313@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=153666 Change 153666 by zec@zec_tpx32 on 2008/11/27 13:16:19 Bring in ip_output.c in sync with svn:head/sys/netinet/ip_output.c, not with //depot/vendor/freebsd/src/sys/netinet/ip_output.c which is broken! Affected files ... .. //depot/projects/vimage-commit2/src/sys/netinet/ip_output.c#13 edit Differences ... ==== //depot/projects/vimage-commit2/src/sys/netinet/ip_output.c#13 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/netinet/ip_output.c,v 1.285 2008/08/21 17:24:49 rwatson Exp $"); +__FBSDID("$FreeBSD: head/sys/netinet/ip_output.c 185348 2008-11-26 22:32:07Z zec $"); #include "opt_ipfw.h" #include "opt_ipsec.h" @@ -83,7 +83,9 @@ (ntohl(a.s_addr)>>8)&0xFF,\ (ntohl(a.s_addr))&0xFF, y); +#ifdef VIMAGE_GLOBALS u_short ip_id; +#endif #ifdef MBUF_STRESS_TEST int mbuf_frag_size = 0; @@ -132,8 +134,10 @@ bzero(ro, sizeof (*ro)); } - if (inp != NULL) + if (inp != NULL) { + M_SETFIB(m, inp->inp_inc.inc_fibnum); INP_LOCK_ASSERT(inp); + } if (opt) { len = 0; @@ -787,6 +791,7 @@ void in_delayed_cksum(struct mbuf *m) { + INIT_VNET_INET(curvnet); struct ip *ip; u_short csum, offset; @@ -822,6 +827,11 @@ error = optval = 0; if (sopt->sopt_level != IPPROTO_IP) { + if ((sopt->sopt_level == SOL_SOCKET) && + (sopt->sopt_name == SO_SETFIB)) { + inp->inp_inc.inc_fibnum = so->so_fibnum; + return (0); + } return (EINVAL); } @@ -1149,7 +1159,11 @@ register struct ip *ip; struct mbuf *copym; - copym = m_copy(m, 0, M_COPYALL); + /* + * Make a deep copy of the packet because we're going to + * modify the pack in order to generate checksums. + */ + copym = m_dup(m, M_DONTWAIT); if (copym != NULL && (copym->m_flags & M_EXT || copym->m_len < hlen)) copym = m_pullup(copym, hlen); if (copym != NULL) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200811271317.mARDHAgC029313>