Wed May 4 15:42:32 2016 UTC ()
fix compilation for ppc.


(christos)
diff -r1.253 -r1.254 src/sys/netinet/ip_output.c

cvs diff -r1.253 -r1.254 src/sys/netinet/ip_output.c (expand / switch to unified diff)

--- src/sys/netinet/ip_output.c 2016/04/28 00:16:56 1.253
+++ src/sys/netinet/ip_output.c 2016/05/04 15:42:32 1.254
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ip_output.c,v 1.253 2016/04/28 00:16:56 ozaki-r Exp $ */ 1/* $NetBSD: ip_output.c,v 1.254 2016/05/04 15:42:32 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. 4 * Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -81,27 +81,27 @@ @@ -81,27 +81,27 @@
81 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 81 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
82 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 82 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
83 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 83 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
84 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 84 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
85 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 85 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
86 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 86 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
87 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 87 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
88 * SUCH DAMAGE. 88 * SUCH DAMAGE.
89 * 89 *
90 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94 90 * @(#)ip_output.c 8.3 (Berkeley) 1/21/94
91 */ 91 */
92 92
93#include <sys/cdefs.h> 93#include <sys/cdefs.h>
94__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.253 2016/04/28 00:16:56 ozaki-r Exp $"); 94__KERNEL_RCSID(0, "$NetBSD: ip_output.c,v 1.254 2016/05/04 15:42:32 christos Exp $");
95 95
96#ifdef _KERNEL_OPT 96#ifdef _KERNEL_OPT
97#include "opt_inet.h" 97#include "opt_inet.h"
98#include "opt_ipsec.h" 98#include "opt_ipsec.h"
99#include "opt_mrouting.h" 99#include "opt_mrouting.h"
100#include "opt_net_mpsafe.h" 100#include "opt_net_mpsafe.h"
101#include "opt_mpls.h" 101#include "opt_mpls.h"
102#endif 102#endif
103 103
104#include <sys/param.h> 104#include <sys/param.h>
105#include <sys/kmem.h> 105#include <sys/kmem.h>
106#include <sys/mbuf.h> 106#include <sys/mbuf.h>
107#include <sys/protosw.h> 107#include <sys/protosw.h>
@@ -1546,28 +1546,28 @@ ip_add_membership(struct ip_moptions *im @@ -1546,28 +1546,28 @@ ip_add_membership(struct ip_moptions *im
1546 return ENOBUFS; 1546 return ENOBUFS;
1547 1547
1548 ++imo->imo_num_memberships; 1548 ++imo->imo_num_memberships;
1549 return 0; 1549 return 0;
1550} 1550}
1551 1551
1552/* 1552/*
1553 * Drop a multicast group membership. 1553 * Drop a multicast group membership.
1554 * Group must be a valid IP multicast address. 1554 * Group must be a valid IP multicast address.
1555 */ 1555 */
1556static int 1556static int
1557ip_drop_membership(struct ip_moptions *imo, const struct sockopt *sopt) 1557ip_drop_membership(struct ip_moptions *imo, const struct sockopt *sopt)
1558{ 1558{
1559 struct in_addr ia; 1559 struct in_addr ia = { .s_addr = 0 }; // XXX: gcc [ppc]
1560 struct ifnet *ifp; 1560 struct ifnet *ifp = NULL; // XXX: gcc [ppc]
1561 int i, error; 1561 int i, error;
1562 1562
1563 if (sopt->sopt_size == sizeof(struct ip_mreq)) 1563 if (sopt->sopt_size == sizeof(struct ip_mreq))
1564 error = ip_get_membership(sopt, &ifp, &ia, false); 1564 error = ip_get_membership(sopt, &ifp, &ia, false);
1565 else 1565 else
1566#ifdef INET6 1566#ifdef INET6
1567 error = ip6_get_membership(sopt, &ifp, &ia, sizeof(ia)); 1567 error = ip6_get_membership(sopt, &ifp, &ia, sizeof(ia));
1568#else 1568#else
1569 return EINVAL; 1569 return EINVAL;
1570#endif 1570#endif
1571 1571
1572 if (error) 1572 if (error)
1573 return error; 1573 return error;