diff options
author | bms <bms@FreeBSD.org> | 2009-11-19 12:21:20 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2009-11-19 12:21:20 +0000 |
commit | 375b60ebd57182e9a9d4bcba62d825bb173cb0f6 (patch) | |
tree | 99a2d59d89703cd8ea04bec6ed4aedc675d8b8c7 /sys/netinet6/in6_mcast.c | |
parent | 63de6a0a63bf8476437bd1976b954c67f7b9e2b1 (diff) | |
download | FreeBSD-src-375b60ebd57182e9a9d4bcba62d825bb173cb0f6.zip FreeBSD-src-375b60ebd57182e9a9d4bcba62d825bb173cb0f6.tar.gz |
Adapt r197314 to IPv6 stack:
Return ENOBUFS consistently if user attempts to exceed
in_mcast_maxsocksrc resource limit.
MFC after: 1 day
Diffstat (limited to 'sys/netinet6/in6_mcast.c')
-rw-r--r-- | sys/netinet6/in6_mcast.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet6/in6_mcast.c b/sys/netinet6/in6_mcast.c index bba34ec..9fc3c48 100644 --- a/sys/netinet6/in6_mcast.c +++ b/sys/netinet6/in6_mcast.c @@ -2342,9 +2342,11 @@ in6p_set_source_filters(struct inpcb *inp, struct sockopt *sopt) if (error) return (error); - if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc || - (msfr.msfr_fmode != MCAST_EXCLUDE && - msfr.msfr_fmode != MCAST_INCLUDE)) + if (msfr.msfr_nsrcs > in6_mcast_maxsocksrc) + return (ENOBUFS); + + if (msfr.msfr_fmode != MCAST_EXCLUDE && + msfr.msfr_fmode != MCAST_INCLUDE) return (EINVAL); if (msfr.msfr_group.ss_family != AF_INET6 || |