On Thu, Apr 25, 2013 at 12:42:09PM +0000, Gleb Smirnoff wrote:
> Modified: head/sys/netinet/ip_output.c
> ==============================================================================
> --- 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 = 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 = ip->ip_hl << 2;
>       }
>  
> +     gw = dst = (struct sockaddr_in *)&ro->ro_dst;
>  again:
> -     dst = (struct sockaddr_in *)&ro->ro_dst;
>       ia = NULL;
>       /*
>        * If there is a cached route,
> @@ -297,11 +298,11 @@ again:
>               ifp = rte->rt_ifp;
>               rte->rt_rmx.rmx_pksent++;
>               if (rte->rt_flags & RTF_GATEWAY)
> -                     dst = (struct sockaddr_in *)rte->rt_gateway;
> +                     gw = (struct sockaddr_in *)rte->rt_gateway;
>               if (rte->rt_flags & RTF_HOST)
>                       isbroadcast = (rte->rt_flags & RTF_BROADCAST);
>               else
> -                     isbroadcast = in_broadcast(dst->sin_addr, ifp);
> +                     isbroadcast = 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 |= 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 = (struct sockaddr_in *)&ro->ro_dst;
> -             /*
>                * See if the caller provided any multicast options
>                */
>               if (imo != NULL) {
> @@ -559,7 +554,6 @@ sendit:
>       /* Or forward to some other address? */
>       if ((m->m_flags & M_IP_NEXTHOP) &&
>           (fwd_tag = m_tag_find(m, PACKET_TAG_IPFORWARD, NULL)) != NULL) {
> -             dst = (struct sockaddr_in *)&ro->ro_dst;
>               bcopy((fwd_tag+1), dst, sizeof(struct sockaddr_in));
>               m->m_flags |= M_SKIP_FIREWALL;
>               m->m_flags &= ~M_IP_NEXTHOP;
> @@ -628,8 +622,7 @@ passout:
>                * to avoid confusing lower layers.
>                */
>               m->m_flags &= ~(M_PROTOFLAGS);
> -             error = (*ifp->if_output)(ifp, m,
> -                             (struct sockaddr *)dst, ro);
> +             error = (*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 
pointer target type

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

Glen

>               goto done;
>       }
>  
> @@ -663,7 +656,7 @@ passout:
>                       m->m_flags &= ~(M_PROTOFLAGS);
>  
>                       error = (*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-unsubscr...@freebsd.org"

Attachment: pgpanHj3DlDkW.pgp
Description: PGP signature

Reply via email to