On Mon, May 04, 2020 at 10:34:29AM -0700, Stanislav Fomichev wrote: > The intent is to add an additional bind parameter in the next commit. > Instead of adding another argument, let's convert all existing > flag arguments into an extendable bit field. > > No functional changes. > > Cc: Andrey Ignatov <rdna@xxxxxx> > Signed-off-by: Stanislav Fomichev <sdf@xxxxxxxxxx> > --- > include/net/inet_common.h | 6 +++++- > include/net/ipv6_stubs.h | 2 +- > net/core/filter.c | 6 ++++-- > net/ipv4/af_inet.c | 10 +++++----- > net/ipv6/af_inet6.c | 10 +++++----- > 5 files changed, 20 insertions(+), 14 deletions(-) > > diff --git a/include/net/inet_common.h b/include/net/inet_common.h > index ae2ba897675c..a0fb68f5bf59 100644 > --- a/include/net/inet_common.h > +++ b/include/net/inet_common.h > @@ -35,8 +35,12 @@ int inet_shutdown(struct socket *sock, int how); > int inet_listen(struct socket *sock, int backlog); > void inet_sock_destruct(struct sock *sk); > int inet_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len); > +// Don't allocate port at this moment, defer to connect. nit. stay with /* ... */ > +#define BIND_FORCE_ADDRESS_NO_PORT (1 << 0) > +// Grab and release socket lock. > +#define BIND_WITH_LOCK (1 << 1)