diff options
| author | Bruce M Simpson <bms@FreeBSD.org> | 2009-05-17 15:42:41 +0000 |
|---|---|---|
| committer | Bruce M Simpson <bms@FreeBSD.org> | 2009-05-17 15:42:41 +0000 |
| commit | c48c09e406bb2dcf88ddb7602ab6673545b8aac5 (patch) | |
| tree | 5c091e0b097092a99ffa2c560a090256eaa362ea /lib/libc | |
| parent | 747782762cebdfc9ed3add9f14221026b5441bfc (diff) | |
Notes
Diffstat (limited to 'lib/libc')
| -rw-r--r-- | lib/libc/net/sourcefilter.c | 34 |
1 files changed, 16 insertions, 18 deletions
diff --git a/lib/libc/net/sourcefilter.c b/lib/libc/net/sourcefilter.c index 14812c51cd74..cc0f1b971e91 100644 --- a/lib/libc/net/sourcefilter.c +++ b/lib/libc/net/sourcefilter.c @@ -1,6 +1,6 @@ /*- - * Copyright (c) 2007 Bruce M. Simpson. - * All rights reserved + * Copyright (c) 2007-2009 Bruce Simpson. + * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -10,21 +10,18 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of Bruce M. Simpson nor the names of other - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. * - * THIS SOFTWARE IS PROVIDED BY BRUCE M. SIMPSON AND AFFILIATES - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BRUCE M. SIMPSON OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. */ #include <sys/cdefs.h> @@ -340,7 +337,7 @@ getsourcefilter(int s, uint32_t interface, struct sockaddr *group, { struct __msfilterreq msfr; sockunion_t *psu; - int err, level, optlen, optname; + int err, level, nsrcs, optlen, optname; if (interface == 0 || group == NULL || numsrc == NULL || fmode == NULL) { @@ -348,6 +345,7 @@ getsourcefilter(int s, uint32_t interface, struct sockaddr *group, return (-1); } + nsrcs = *numsrc; *numsrc = 0; *fmode = 0; @@ -385,7 +383,7 @@ getsourcefilter(int s, uint32_t interface, struct sockaddr *group, memset(&msfr, 0, optlen); msfr.msfr_ifindex = interface; msfr.msfr_fmode = 0; - msfr.msfr_nsrcs = *numsrc; + msfr.msfr_nsrcs = nsrcs; memcpy(&msfr.msfr_group, &psu->ss, psu->ss.ss_len); /* |
