[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJy3la53tn3mS3Jc@shredder>
Date: Wed, 13 Aug 2025 19:04:37 +0300
From: Ido Schimmel <idosch@...dia.com>
To: Richard Gobert <richardbgobert@...il.com>
Cc: Kuniyuki Iwashima <kuniyu@...gle.com>, andrew+netdev@...n.ch,
daniel@...earbox.net, davem@...emloft.net, donald.hunter@...il.com,
dsahern@...nel.org, edumazet@...gle.com, horms@...nel.org,
jacob.e.keller@...el.com, kuba@...nel.org,
linux-kernel@...r.kernel.org, martin.lau@...nel.org,
menglong8.dong@...il.com, netdev@...r.kernel.org, pabeni@...hat.com,
petrm@...dia.com, razor@...ckwall.org, shuah@...nel.org
Subject: Re: [PATCH net-next v5 2/5] net: vxlan: add netlink option to bind
vxlan sockets to local addresses
On Wed, Aug 13, 2025 at 05:46:44PM +0200, Richard Gobert wrote:
> Kuniyuki Iwashima wrote:
> > From: Richard Gobert <richardbgobert@...il.com>
> >> @@ -4044,15 +4045,37 @@ static int vxlan_nl2conf(struct nlattr *tb[], struct nlattr *data[],
> >> conf->vni = vni;
> >> }
> >>
> >> + if (data[IFLA_VXLAN_LOCALBIND]) {
> >> + if (changelink) {
> >> + NL_SET_ERR_MSG_ATTR(extack, tb[IFLA_VXLAN_LOCALBIND], "Cannot rebind locally");
> >> + return -EOPNOTSUPP;
> >> + }
> >
> > Are these two "if" necessary ?
>
> Creating a vxlan interface without localbind then adding localbind won't
> result in the socket being rebound. I might implement this in the future,
> but for simplicity, I didn't implement this yet.
I think Kuniyuki meant that you can just call vxlan_nl2flag() without
those two "if"s because the function is a NO-OP when the attribute is
not present and it will also fail the changelink operation.
>
> >
> >
> >> +
> >> + err = vxlan_nl2flag(conf, data, IFLA_VXLAN_LOCALBIND,
> >> + VXLAN_F_LOCALBIND, changelink,
> >> + false, extack);
> >> + if (err)
> >> + return err;
> >> + }
> >> +
Powered by blists - more mailing lists