Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Apr 2013 07:50:21 -0400
From:      Glen Barber <gjb@FreeBSD.org>
To:        Gleb Smirnoff <glebius@FreeBSD.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r249894 - head/sys/netinet
Message-ID:  <20130426115021.GE1600@glenbarber.us>
In-Reply-To: <201304251242.r3PCg9K9058086@svn.freebsd.org>
References:  <201304251242.r3PCg9K9058086@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

--u5E4XgoOPWr4PD9E
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Apr 25, 2013 at 12:42:09PM +0000, Gleb Smirnoff wrote:
> Modified: head/sys/netinet/ip_output.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/sys/netinet/ip_output.c	Thu Apr 25 12:05:17 2013	(r249893)
> +++ head/sys/netinet/ip_output.c	Thu Apr 25 12:42:09 2013	(r249894)
> @@ -123,6 +123,7 @@ ip_output(struct mbuf *m, struct mbuf *o
>  	int n;	/* scratchpad */
>  	int error =3D 0;
>  	struct sockaddr_in *dst;
> +	const struct sockaddr_in *gw;
>  	struct in_ifaddr *ia;
>  	int isbroadcast;
>  	uint16_t ip_len, ip_off;
> @@ -196,8 +197,8 @@ ip_output(struct mbuf *m, struct mbuf *o
>  		hlen =3D ip->ip_hl << 2;
>  	}
> =20
> +	gw =3D dst =3D (struct sockaddr_in *)&ro->ro_dst;
>  again:
> -	dst =3D (struct sockaddr_in *)&ro->ro_dst;
>  	ia =3D NULL;
>  	/*
>  	 * If there is a cached route,
> @@ -297,11 +298,11 @@ again:
>  		ifp =3D rte->rt_ifp;
>  		rte->rt_rmx.rmx_pksent++;
>  		if (rte->rt_flags & RTF_GATEWAY)
> -			dst =3D (struct sockaddr_in *)rte->rt_gateway;
> +			gw =3D (struct sockaddr_in *)rte->rt_gateway;
>  		if (rte->rt_flags & RTF_HOST)
>  			isbroadcast =3D (rte->rt_flags & RTF_BROADCAST);
>  		else
> -			isbroadcast =3D in_broadcast(dst->sin_addr, ifp);
> +			isbroadcast =3D in_broadcast(gw->sin_addr, ifp);
>  	}
>  	/*
>  	 * Calculate MTU.  If we have a route that is up, use that,
> @@ -327,12 +328,6 @@ again:
>  	if (IN_MULTICAST(ntohl(ip->ip_dst.s_addr))) {
>  		m->m_flags |=3D M_MCAST;
>  		/*
> -		 * IP destination address is multicast.  Make sure "dst"
> -		 * still points to the address in "ro".  (It may have been
> -		 * changed to point to a gateway address, above.)
> -		 */
> -		dst =3D (struct sockaddr_in *)&ro->ro_dst;
> -		/*
>  		 * See if the caller provided any multicast options
>  		 */
>  		if (imo !=3D NULL) {
> @@ -559,7 +554,6 @@ sendit:
>  	/* Or forward to some other address? */
>  	if ((m->m_flags & M_IP_NEXTHOP) &&
>  	    (fwd_tag =3D m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) !=3D NULL) {
> -		dst =3D (struct sockaddr_in *)&ro->ro_dst;
>  		bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in));
>  		m->m_flags |=3D M_SKIP_FIREWALL;
>  		m->m_flags &=3D ~M_IP_NEXTHOP;
> @@ -628,8 +622,7 @@ passout:
>  		 * to avoid confusing lower layers.
>  		 */
>  		m->m_flags &=3D ~(M_PROTOFLAGS);
> -		error =3D (*ifp->if_output)(ifp, m,
> -		    		(struct sockaddr *)dst, ro);
> +		error =3D (*ifp->if_output)(ifp, m, (struct sockaddr *)gw, ro);

It looks like this change is causing tinderbox build failures on head/ :


--------------------- begin quoted text ---------------------

/src/sys/netinet/ip_output.c: In function 'ip_output':
/src/sys/netinet/ip_output.c:625: warning: cast discards qualifiers from po=
inter target type

---------------------- end quoted text ----------------------

Glen

>  		goto done;
>  	}
> =20
> @@ -663,7 +656,7 @@ passout:
>  			m->m_flags &=3D ~(M_PROTOFLAGS);
> =20
>  			error =3D (*ifp->if_output)(ifp, m,
> -			    (struct sockaddr *)dst, ro);
> +			    (struct sockaddr *)gw, ro);
>  		} else
>  			m_freem(m);
>  	}
> _______________________________________________
> svn-src-all@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/svn-src-all
> To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"

--u5E4XgoOPWr4PD9E
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (FreeBSD)

iQEcBAEBCAAGBQJRemn9AAoJEFJPDDeguUaj3KIH/i4+DO5lFDJJ4rIwBLBWqU0d
nBq1H3Hsc7OuYeP/9j2Fle0FgcdspCneuBr1AxueKVrQT1/ykJMNXo/kOcFXHWfa
/HQtGWmPEriKC5Vp88sV5KNMA/32twqSOEX61A528k6pf3lPu3B53lZdl1WW9Zd7
uP02IcvpGfyeNxqjcLkvFZKKNt7DcVPg3KN8NX/klhjjOxGpaKCQXxfyF4xSpbGb
4cGbJ/yLsBIuMz+dJFS2IZnU4teRa/lZG+gk8ifwhkPIy1DHxuwSuHMq8aJdq6qa
aqbGNoObpuI4j775Spi/yDL7pAC728tp1VbLrCO7/Oab1JFA33LSEc3wsZRRgKw=
=gzAQ
-----END PGP SIGNATURE-----

--u5E4XgoOPWr4PD9E--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130426115021.GE1600>