search for: dev_net

Displaying 20 results from an estimated 72 matches for "dev_net".

2023 Jul 12
0
[Bridge] llc needs namespace awareness asap, was Re: Patch fixing STP if bridge in non-default namespace.
...ietfountain.com> > Date: Tue, 11 Jul 2023 16:40:03 -0500 >> On 7/11/23 15:44, Andrew Lunn wrote: >> >>>>>> The current llc_rcv.c around line 166 in net/llc/llc_input.c has >> >>>>>> >> >>>>>> if (!net_eq(dev_net(dev), &init_net)) >> >>>>>> goto drop; >> >>>>>> >> >> Thank you! When you offer your patches, and you hear worries about being >> >> 'invasive', it's worth asking 'compared to what'...
2023 Jul 12
2
[Bridge] [PATCH v1 net] bridge: Return an error when enabling STP in netns.
....c b/net/bridge/br_stp_if.c > index a807996ac56b..b5143de37938 100644 > --- a/net/bridge/br_stp_if.c > +++ b/net/bridge/br_stp_if.c > @@ -201,10 +201,8 @@ int br_stp_set_enabled(struct net_bridge *br, unsigned long val, > { > ASSERT_RTNL(); > > - if (!net_eq(dev_net(br->dev), &init_net)) { > + if (!net_eq(dev_net(br->dev), &init_net)) > NL_SET_ERR_MSG_MOD(extack, "STP can't be enabled in non-root netns"); > - return -EINVAL; > - } > > if (br_mrp_enabled(br)) { &gt...
2019 Mar 21
2
[PATCH net v2] failover: allow name change on IFF_UP slave interfaces
.../** > * struct net_device - The DEVICE structure. > diff --git a/net/core/dev.c b/net/core/dev.c > index 722d50d..ae070de 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1180,7 +1180,8 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > + if (dev->flags & IFF_UP && > + !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) > return -EBUSY; > > write_seqcount_begin(&devnet_rename_seq); > diff --git a/net/core/...
2019 Mar 21
2
[PATCH net v2] failover: allow name change on IFF_UP slave interfaces
.../** > * struct net_device - The DEVICE structure. > diff --git a/net/core/dev.c b/net/core/dev.c > index 722d50d..ae070de 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1180,7 +1180,8 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > + if (dev->flags & IFF_UP && > + !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) > return -EBUSY; > > write_seqcount_begin(&devnet_rename_seq); > diff --git a/net/core/...
2018 Feb 17
1
[RFC PATCH v3 2/3] virtio_net: Extend virtio to use VF datapath when available
...ght, I'm probably missing something... > + if (ether_addr_equal(mac, dev->perm_addr)) > + return dev; > + } > + > + return NULL; > +} > + > +static struct net_device * > +get_virtnet_bypass_byref(struct net_device *child_netdev) > +{ > + struct net *net = dev_net(child_netdev); > + struct net_device *dev; > + > + ASSERT_RTNL(); > + > + for_each_netdev(net, dev) { > + struct virtnet_bypass_info *vbi; > + > + if (dev->netdev_ops != &virtnet_bypass_netdev_ops) > + continue; /* not a virtnet_bypass device */ > + &g...
2019 Mar 29
0
[PATCH net v4] failover: allow name change on IFF_UP slave interfaces
...1173 * for wildcarding. 1174 */ 1175 int dev_change_name(struct net_device *dev, const char *newname) 1176 { 1177 unsigned char old_assign_type; 1178 char oldname[IFNAMSIZ]; 1179 int err = 0; 1180 int ret; 1181 struct net *net; 1182 1183 ASSERT_RTNL(); 1184 BUG_ON(!dev_net(dev)); 1185 1186 net = dev_net(dev); 1187 1188 /* Allow failover slave to rename even when 1189 * it is up and running. 1190 * 1191 * Failover slaves are special, since userspace 1192 * might rename the slave after the interface 1193 * has been brought up and running...
2019 Mar 28
0
[PATCH net v3] failover: allow name change on IFF_UP slave interfaces
.../ 1175 int dev_change_name(struct net_device *dev, const char *newname) 1176 { 1177 unsigned char old_assign_type; 1178 bool reopen_needed = false; 1179 char oldname[IFNAMSIZ]; 1180 int err = 0; 1181 int ret; 1182 struct net *net; 1183 1184 ASSERT_RTNL(); 1185 BUG_ON(!dev_net(dev)); 1186 1187 net = dev_net(dev); 1188 1189 /* Allow failover slave to rename even when 1190 * it is up and running. 1191 * 1192 * Failover slaves are special, since userspace 1193 * might rename the slave after the interface 1194 * has been brought up and running...
2019 Apr 02
0
[PATCH net v5] failover: allow name change on IFF_UP slave interfaces
...1 file changed, 24 insertions(+), 1 deletion(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 9823b77..b694184 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1185,7 +1185,21 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > + > + /* Allow failover slave to rename even when > + * it is up and running. > + * > + * Failover slaves are special, since userspace > + * might rename the slave after the interface > + *...
2019 Apr 02
0
[PATCH net v5] failover: allow name change on IFF_UP slave interfaces
...1 file changed, 24 insertions(+), 1 deletion(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 9823b77..b694184 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1185,7 +1185,21 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > + > + /* Allow failover slave to rename even when > + * it is up and running. > + * > + * Failover slaves are special, since userspace > + * might rename the slave after the interface > + * h...
2019 Mar 29
0
[PATCH net v4] failover: allow name change on IFF_UP slave interfaces
...1 file changed, 23 insertions(+), 1 deletion(-) > > diff --git a/net/core/dev.c b/net/core/dev.c > index 722d50d..6ae5874 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1180,7 +1180,21 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > + > + /* Allow failover slave to rename even when > + * it is up and running. > + * > + * Failover slaves are special, since userspace > + * might rename the slave after the interface > + *...
2023 Jul 11
3
[Bridge] [PATCH v1 net] bridge: Return an error when enabling STP in netns.
..., 5 insertions(+) diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c index 75204d36d7f9..a807996ac56b 100644 --- a/net/bridge/br_stp_if.c +++ b/net/bridge/br_stp_if.c @@ -201,6 +201,11 @@ int br_stp_set_enabled(struct net_bridge *br, unsigned long val, { ASSERT_RTNL(); + if (!net_eq(dev_net(br->dev), &init_net)) { + NL_SET_ERR_MSG_MOD(extack, "STP can't be enabled in non-root netns"); + return -EINVAL; + } + if (br_mrp_enabled(br)) { NL_SET_ERR_MSG_MOD(extack, "STP can't be enabled if MRP is already enabled"); -- 2.30.2
2019 Mar 28
0
[PATCH net v3] failover: allow name change on IFF_UP slave interfaces
...gt;> unsigned char old_assign_type; > >> + bool reopen_needed = false; > >> char oldname[IFNAMSIZ]; > >> int err = 0; > >> int ret; > >> @@ -1180,8 +1181,24 @@ int dev_change_name(struct net_device *dev, const char *newname) > >> BUG_ON(!dev_net(dev)); > >> > >> net = dev_net(dev); > >> - if (dev->flags & IFF_UP) > >> - return -EBUSY; > >> + > >> + /* Allow failover slave to rename even when > >> + * it is up and running. > >> + * > >> + * Failover...
2019 Mar 27
0
[PATCH net v3] failover: allow name change on IFF_UP slave interfaces
...e_name(struct net_device *dev, const char *newname) > { > unsigned char old_assign_type; >+ bool reopen_needed = false; > char oldname[IFNAMSIZ]; > int err = 0; > int ret; >@@ -1180,8 +1181,24 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); >- if (dev->flags & IFF_UP) >- return -EBUSY; >+ >+ /* Allow failover slave to rename even when >+ * it is up and running. >+ * >+ * Failover slaves are special, since userspace >+ * might rename the slave after the interfac...
2019 Mar 29
0
[PATCH net v4] failover: allow name change on IFF_UP slave interfaces
...t a/net/core/dev.c b/net/core/dev.c > > > index 722d50d..6ae5874 100644 > > > --- a/net/core/dev.c > > > +++ b/net/core/dev.c > > > @@ -1180,7 +1180,21 @@ int dev_change_name(struct net_device *dev, > > > const char *newname) > > > BUG_ON(!dev_net(dev)); > > > net = dev_net(dev); > > > - if (dev->flags & IFF_UP) > > > + > > > + /* Allow failover slave to rename even when > > > + * it is up and running. > > > + * > > > + * Failover slaves are speci...
2019 Mar 07
0
[PATCH net v2] failover: allow name change on IFF_UP slave interfaces
...** > * struct net_device - The DEVICE structure. > diff --git a/net/core/dev.c b/net/core/dev.c > index 722d50d..ae070de 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1180,7 +1180,8 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > + if (dev->flags & IFF_UP && > + !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) > return -EBUSY; Without the configurable module parameter, i think we don't even need the new S...
2019 Mar 06
0
[RFC PATCH net-next] failover: allow name change on IFF_UP slave interfaces
...; > /** > * struct net_device - The DEVICE structure. >diff --git a/net/core/dev.c b/net/core/dev.c >index 722d50d..ae070de 100644 >--- a/net/core/dev.c >+++ b/net/core/dev.c >@@ -1180,7 +1180,8 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); >- if (dev->flags & IFF_UP) >+ if (dev->flags & IFF_UP && >+ !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) > return -EBUSY; > > write_seqcount_begin(&devnet_rename_seq); >diff --git a/net/core/failover....
2019 Mar 05
0
[RFC PATCH net-next] failover: allow name change on IFF_UP slave interfaces
.../** > * struct net_device - The DEVICE structure. > diff --git a/net/core/dev.c b/net/core/dev.c > index 722d50d..ae070de 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -1180,7 +1180,8 @@ int dev_change_name(struct net_device *dev, const char *newname) > BUG_ON(!dev_net(dev)); > > net = dev_net(dev); > - if (dev->flags & IFF_UP) > + if (dev->flags & IFF_UP && > + !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) > return -EBUSY; > > write_seqcount_begin(&devnet_rename_seq); > diff --git a/net/core/...
2019 Mar 21
0
[PATCH net v2] failover: allow name change on IFF_UP slave interfaces
...t_device - The DEVICE structure. >> diff --git a/net/core/dev.c b/net/core/dev.c >> index 722d50d..ae070de 100644 >> --- a/net/core/dev.c >> +++ b/net/core/dev.c >> @@ -1180,7 +1180,8 @@ int dev_change_name(struct net_device *dev, const char *newname) >> BUG_ON(!dev_net(dev)); >> >> net = dev_net(dev); >> - if (dev->flags & IFF_UP) >> + if (dev->flags & IFF_UP && >> + !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) >> return -EBUSY; >> >> write_seqcount_begin(&devnet_rename_seq);...
2019 Mar 21
0
[PATCH net v2] failover: allow name change on IFF_UP slave interfaces
.../dev.c b/net/core/dev.c >>>> index 722d50d..ae070de 100644 >>>> --- a/net/core/dev.c >>>> +++ b/net/core/dev.c >>>> @@ -1180,7 +1180,8 @@ int dev_change_name(struct net_device *dev, >>>> const char *newname) >>>> ????? BUG_ON(!dev_net(dev)); >>>> ??????? net = dev_net(dev); >>>> -??? if (dev->flags & IFF_UP) >>>> +??? if (dev->flags & IFF_UP && >>>> +??????? !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) >>>> ????????? return -EBUSY; >>>...
2019 Mar 21
0
[PATCH net v2] failover: allow name change on IFF_UP slave interfaces
...e. > >> diff --git a/net/core/dev.c b/net/core/dev.c > >> index 722d50d..ae070de 100644 > >> --- a/net/core/dev.c > >> +++ b/net/core/dev.c > >> @@ -1180,7 +1180,8 @@ int dev_change_name(struct net_device *dev, const char *newname) > >> BUG_ON(!dev_net(dev)); > >> > >> net = dev_net(dev); > >> - if (dev->flags & IFF_UP) > >> + if (dev->flags & IFF_UP && > >> + !(dev->priv_flags & IFF_SLAVE_RENAME_OK)) > >> return -EBUSY; > >> > >> write_...