From: Martin Schiller <ms@dev.tdt.de>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v3] net/tun: Call netdev notifiers
Date: Wed, 18 Nov 2020 06:22:31 +0100 [thread overview]
Message-ID: <dcb57be8465c1aa21b21b8478290999f@dev.tdt.de> (raw)
In-Reply-To: <20201117163245.4ff522ef@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>
On 2020-11-18 01:32, Jakub Kicinski wrote:
> On Mon, 16 Nov 2020 11:41:21 +0100 Martin Schiller wrote:
>> Call netdev notifiers before and after changing the device type.
>>
>> Signed-off-by: Martin Schiller <ms@dev.tdt.de>
>> ---
>>
>> Change from v2:
>> use subject_prefix 'net-next' to fix 'fixes_present' issue
>>
>> Change from v1:
>> fix 'subject_prefix' and 'checkpatch' warnings
>>
>> ---
>> drivers/net/tun.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/drivers/net/tun.c b/drivers/net/tun.c
>> index 3d45d56172cb..2d9a00f41023 100644
>> --- a/drivers/net/tun.c
>> +++ b/drivers/net/tun.c
>> @@ -3071,9 +3071,13 @@ static long __tun_chr_ioctl(struct file *file,
>> unsigned int cmd,
>> "Linktype set failed because interface is up\n");
>> ret = -EBUSY;
>> } else {
>> + call_netdevice_notifiers(NETDEV_PRE_TYPE_CHANGE,
>> + tun->dev);
>
> This call may return an error (which has to be unpacked with
> notifier_to_errno()).
OK, I'll fix that and send a v3 patch.
>
>> tun->dev->type = (int) arg;
>> netif_info(tun, drv, tun->dev, "linktype set to %d\n",
>> tun->dev->type);
>> + call_netdevice_notifiers(NETDEV_POST_TYPE_CHANGE,
>> + tun->dev);
>> ret = 0;
>> }
>> break;
prev parent reply other threads:[~2020-11-18 5:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-16 10:41 Martin Schiller
2020-11-18 0:32 ` Jakub Kicinski
2020-11-18 5:22 ` Martin Schiller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=dcb57be8465c1aa21b21b8478290999f@dev.tdt.de \
--to=ms@dev.tdt.de \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome