diff options
author | bms <bms@FreeBSD.org> | 2006-05-14 14:22:49 +0000 |
---|---|---|
committer | bms <bms@FreeBSD.org> | 2006-05-14 14:22:49 +0000 |
commit | 18895e4f429bdde8c9a49ec2740de9f7ee1eb851 (patch) | |
tree | 0b86a0cd16f824f56236d76a1229680116c518af /sys/netinet/in.h | |
parent | 28c1069b5c9c208fec373fcfcd5aa45351b7bc2a (diff) | |
download | FreeBSD-src-18895e4f429bdde8c9a49ec2740de9f7ee1eb851.zip FreeBSD-src-18895e4f429bdde8c9a49ec2740de9f7ee1eb851.tar.gz |
Fix a long-standing limitation in IPv4 multicast group membership.
By making the imo_membership array a dynamically allocated vector,
this minimizes disruption to existing IPv4 multicast code. This
change breaks the ABI for the kernel module ip_mroute.ko, and may
cause a small amount of churn for folks working on the IGMPv3 merge.
Previously, sockets were subject to a compile-time limitation on
the number of IPv4 group memberships, which was hard-coded to 20.
The imo_membership relationship, however, is 1:1 with regards to
a tuple of multicast group address and interface address. Users who
ran routing protocols such as OSPF ran into this limitation on machines
with a large system interface tree.
Diffstat (limited to 'sys/netinet/in.h')
-rw-r--r-- | sys/netinet/in.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/netinet/in.h b/sys/netinet/in.h index 1476bf4..570ed33 100644 --- a/sys/netinet/in.h +++ b/sys/netinet/in.h @@ -424,7 +424,14 @@ __END_DECLS */ #define IP_DEFAULT_MULTICAST_TTL 1 /* normally limit m'casts to 1 hop */ #define IP_DEFAULT_MULTICAST_LOOP 1 /* normally hear sends if a member */ -#define IP_MAX_MEMBERSHIPS 20 /* per socket */ + +/* + * The imo_membership vector for each socket is now dynamically allocated at + * run-time, bounded by USHRT_MAX, and is reallocated when needed, sized + * according to a power-of-two increment. + */ +#define IP_MIN_MEMBERSHIPS 31 +#define IP_MAX_MEMBERSHIPS 4095 /* * Argument structure for IP_ADD_MEMBERSHIP and IP_DROP_MEMBERSHIP. |