On Mon, Aug 08, 2005 at 11:52:08AM +0200, Patrick McHardy ([EMAIL PROTECTED]) wrote: > Evgeniy Polyakov wrote: > > On Mon, Aug 08, 2005 at 01:03:44AM +0200, Patrick McHardy ([EMAIL > > PROTECTED]) wrote: > > > >>Yes, the patches are almost ready but I could use some ideas > >>for one remaining problem. The idea was that a subsystem which > >>sends broadcast messages can specify how many groups are present, > >>probably as a parameter to netlink_kernel_create. This information > >>is needed to properly size the groups mask in struct netlink_sock > >>(this mask is still needed). The problem is that sockets can bind > >>to groups before a kernel socket is created, or in the case of > >>a userspace implemented protocol, none is ever created. To solve > >>this we could forbid binding to groups before either a kernel > >>socket is created or userspace has registered how many groups > >>are present using setsockopt. The questions regarding this are > >>if the bind-change could cause problems for userspace and whether > >>we should take care of userspace implemented protocols at all or > >>simply return -ESOCKTNOSUPPORT in netlink_create if no kernel > >>socket exists. > > > > Should it be possible to specify remote groups in sending time? > > I.e. netlink_broadcast(..., u32 *array_of_groups, int number_of_groups); > > This will not hurt existing userspace applications. > > Yes, but this is not the problem. There is no user of netlink_broadcast > which sends to multiple groups. The problem is that binding to groups > is possible before a kernel socket exists, so we don't know the > number of groups. I would prefer to avoid reallocation of the group > mask.
Hmm, could you please explain more precisely? If I understood you correctly, you care about the case, when userspace is bound to socket S and group G, but kernel side does not have this socket and/or this group, and when it is created, it does not know, if such group G exist. So on creation time you want to specify those group G to be included into groupset for socket S. But how does it differ from the case, when socket already exists and userspace tries to bind to some new group, which is not in the groupset for socket S? -- Evgeniy Polyakov - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html