Re: [systemd-devel] networkd config for dummy0 interface

2014-07-01 Thread Matthias Schiffer
On 07/01/2014 01:58 PM, Tom Gundersen wrote:
> On Mon, Jun 30, 2014 at 11:47 PM, Matthias Schiffer
>  wrote:
>> On 06/24/2014 12:25 PM, Tom Gundersen wrote:
>>> On Tue, Jun 24, 2014 at 12:14 PM, Vasiliy Tolstov  
>>> wrote:
>>>> Hi. I have very strange task:
>>>
>>> Not tested, but I would start with trying:
>>>
>>>> 1) Nedd modprobe dummy
>>>
>>> Use modules-load.d
>>>
>>>> 2) Assign specific mac address to it
>>>
>>> Possibly use .link files, or check if it is possible to spcify this as
>>> module options (didn't check).
>>>
>>>> 3) Bring up it
>>>> 4) Assign specific address to it
>>>
>>> Use a regular .network file... Should wokr.
>>>
>>> HTH,
>>>
>>> Tom
>>
>> I'm not sure if this has changed recently, but I think it is not
>> possible to use .link files to configure virtual network devices as
>> there is _nothing_ to match on.
> 
> Indeed.
> 
>> As I mentioned in another discussion (regarding bridge MAC addresses),
>> I've added the following udev rule as a workaround, which allows
>> matching for virtual device names using the Path= match (I need this for
>> a batman-adv device, I guess there are tons of other device types which
>> are similar):
>>
>> ENV{DEVPATH}=="/devices/virtual/net/*", ENV{ID_PATH}=="",
>> ENV{ID_PATH}="virtual-$kernel"
>>
>> I think we really need a name match for virtual devices which have
>> neither a persistent MAC address nor a device path to match on in .link
>> units. It might be called VirtualName= and only work for devices that
>> don't have a path so people don't try to use it when a Path= match would
>> be more appropriate...
> 
> Once the kernel learns to distinguish real names from the ethX names,
> then this may make some sense, but I still don't really like the idea
> as people could still be renaming the links, and then it would get
> really confusing what name to use...
> 
> I think a better solution is to set the properties on the virtual
> devices you want when you create them. We already do this for mac
> addresses (in git at least), but other properties could be added too
> as needed.
> 
> Cheers,
> 
> Tom

I don't think it's always possible to set the address when an interface
is created; one example would be interfaces that aren't created
explicitly, but as a side effect (I'm thinking of things like the peer
side of a veth pair; batman-adv had similar behaviour until about 1 year
ago).

For such devices, udev rules are the only way to ensure link parameters
are set before udev tells the rest of the systems the device is ready.
Adding support for such devices in .link units would make things a lot
nicer.

An alternative would be adding support to the kernel for setting the
link parameters of all such devices at creation time. I have no idea if
this would be worth the effort, or even possible for all kinds of devices...



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd config for dummy0 interface

2014-06-30 Thread Matthias Schiffer
On 07/01/2014 05:56 AM, Christian Hesse wrote:
> Matthias Schiffer  on Mon, 2014/06/30 23:47:
>> On 06/24/2014 12:25 PM, Tom Gundersen wrote:
>>> On Tue, Jun 24, 2014 at 12:14 PM, Vasiliy Tolstov 
>>> wrote:
>>>> Hi. I have very strange task:
>>>
>>> Not tested, but I would start with trying:
>>>
>>>> 1) Nedd modprobe dummy
>>>
>>> Use modules-load.d
>>>
>>>> 2) Assign specific mac address to it
>>>
>>> Possibly use .link files, or check if it is possible to spcify this as
>>> module options (didn't check).
>>>
>>>> 3) Bring up it
>>>> 4) Assign specific address to it
>>>
>>> Use a regular .network file... Should wokr.
>>>
>>> HTH,
>>>
>>> Tom
>>
>> I'm not sure if this has changed recently, but I think it is not
>> possible to use .link files to configure virtual network devices as
>> there is _nothing_ to match on.
> 
> Sure. You have a name. That is what I tried first and it works perfectly.
> 
> [Match]
> Name=dummy0
> 
> Or did I miss anything?
> 

No, Name= matches only work in .network units, not in .link units. A
link unit without any valid match option matches any interface though;
so if you have a .link unit with Name=dummy0 in its [Match] section, it
will actually be applied to dummy0... but also to all other interfaces,
which can be very confusing.



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] networkd config for dummy0 interface

2014-06-30 Thread Matthias Schiffer
On 06/24/2014 12:25 PM, Tom Gundersen wrote:
> On Tue, Jun 24, 2014 at 12:14 PM, Vasiliy Tolstov  wrote:
>> Hi. I have very strange task:
> 
> Not tested, but I would start with trying:
> 
>> 1) Nedd modprobe dummy
> 
> Use modules-load.d
> 
>> 2) Assign specific mac address to it
> 
> Possibly use .link files, or check if it is possible to spcify this as
> module options (didn't check).
> 
>> 3) Bring up it
>> 4) Assign specific address to it
> 
> Use a regular .network file... Should wokr.
> 
> HTH,
> 
> Tom

I'm not sure if this has changed recently, but I think it is not
possible to use .link files to configure virtual network devices as
there is _nothing_ to match on.

As I mentioned in another discussion (regarding bridge MAC addresses),
I've added the following udev rule as a workaround, which allows
matching for virtual device names using the Path= match (I need this for
a batman-adv device, I guess there are tons of other device types which
are similar):

ENV{DEVPATH}=="/devices/virtual/net/*", ENV{ID_PATH}=="",
ENV{ID_PATH}="virtual-$kernel"

I think we really need a name match for virtual devices which have
neither a persistent MAC address nor a device path to match on in .link
units. It might be called VirtualName= and only work for devices that
don't have a path so people don't try to use it when a Path= match would
be more appropriate...



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-05-12 Thread Matthias Schiffer
>>> This should really be added as AFAICT there is currently no way to match
>>> on virtual devices like briges, TAP devices, batman-adv devices, etc...
>>> which have neither a persistent MAC address nor an ID_PATH to match on.
>>
>> So I think what we should do here is to allow MAC address (and other
>> things) to be set when creating the netdevs. I made an attempt at this
>> by generating a "predictable" one based on the interface name and the
>> machine-id. Would that do it for you, or are you after a _specific_
>> mac address, rather than just one that is always the same? I had to
>> revert the code doing this for now as there was a kernel bug, however
>> we'll hopefully get that sorted soon and then get back to this.
>>
>> Cheers,
>>
>> Tom
>>
> 
> For my usecase, a predictable, but otherwise random MAC address would
> do. But I also see that setting an arbitrary MAC address (or any other
> link parameter) for a specific virtual device is useful as well
> (especially as it is possible to do so with real devices). As virtual
> devices are almost always created with specific names, a Name= match for
> .link units would make the most sense in my opinion.
> 
> As a workaround, I've added the following udev rule to
> 80-net-setup-link.rules for now to allow matching for virtual devices
> with Path= matches:
> 
> ENV{DEVPATH}=="/devices/virtual/net/*", ENV{ID_PATH}=="",
> ENV{ID_PATH}="virtual-$kernel"
> 
> Thanks,
> Matthias
> 

Ping. There is still no way to match for virtual devices in .link units
without my workaround. Is it planned to add something similar? Would a
facility allowing to configure the MAC address of a virtual device be in
the scope of the TODO point "add reduced [Link] support to .network files"?



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-22 Thread Matthias Schiffer
On 04/22/2014 04:07 PM, Tom Gundersen wrote:
> Hi Matthias,
> 
> On Fri, Apr 18, 2014 at 1:08 AM, Matthias Schiffer
>  wrote:
>> On 04/18/2014 12:14 AM, Matthias Schiffer wrote:
>>> On 04/17/2014 11:28 PM, Dave Reisner wrote:
>>>> On Thu, Apr 17, 2014 at 11:02:11PM +0200, Matthias Schiffer wrote:
>>>>> Hi,
>>>>> I'd like to configure the MAC address of a bridge device statically (as
>>>>> bridges tend to change their MAC address depending on the order the
>>>>> ports are added on Linux otherwise), but there doesn't seem to be a way
>>>>> to match for a bridge in a .link unit. This would be very useful for
>>>>> macvlans as well.
>>>>
>>>> Link files can match bridges generally with Type=bridge or Driver=bridge
>>>> in the [Match] section, or more specifically by just matching on name.
>>>> In the [Link] section, MACAddressPolicy=persistent should give you
>>>> persistent hw addresses in the general case, or you can use
>>>> MACAddress=fe:ed:fa:ce:be:ef to set whatever you like for more specific
>>>> matches.
>>>>
>>>> Does this not work for you?
>>> Hmm, I thought I tried that before, but using
>>> MACAddress=fe:ed:fa:ce:be:ef seems to work now. Please note that the
>>> Name= match is not documented in the systemd.link manpage.
>>
>> I have to correct myself: The Name= match does not exist for .link
>> units. My testcase just seemed to work as a [Match] section only
>> consisting of a Name= match was considered an empty [Match] section and
>> matched on all devices...
>>
>> This should really be added as AFAICT there is currently no way to match
>> on virtual devices like briges, TAP devices, batman-adv devices, etc...
>> which have neither a persistent MAC address nor an ID_PATH to match on.
> 
> So I think what we should do here is to allow MAC address (and other
> things) to be set when creating the netdevs. I made an attempt at this
> by generating a "predictable" one based on the interface name and the
> machine-id. Would that do it for you, or are you after a _specific_
> mac address, rather than just one that is always the same? I had to
> revert the code doing this for now as there was a kernel bug, however
> we'll hopefully get that sorted soon and then get back to this.
> 
> Cheers,
> 
> Tom
> 

For my usecase, a predictable, but otherwise random MAC address would
do. But I also see that setting an arbitrary MAC address (or any other
link parameter) for a specific virtual device is useful as well
(especially as it is possible to do so with real devices). As virtual
devices are almost always created with specific names, a Name= match for
.link units would make the most sense in my opinion.

As a workaround, I've added the following udev rule to
80-net-setup-link.rules for now to allow matching for virtual devices
with Path= matches:

ENV{DEVPATH}=="/devices/virtual/net/*", ENV{ID_PATH}=="",
ENV{ID_PATH}="virtual-$kernel"

Thanks,
Matthias



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-17 Thread Matthias Schiffer
On 04/18/2014 12:14 AM, Matthias Schiffer wrote:
> On 04/17/2014 11:28 PM, Dave Reisner wrote:
>> On Thu, Apr 17, 2014 at 11:02:11PM +0200, Matthias Schiffer wrote:
>>> Hi,
>>> I'd like to configure the MAC address of a bridge device statically (as
>>> bridges tend to change their MAC address depending on the order the
>>> ports are added on Linux otherwise), but there doesn't seem to be a way
>>> to match for a bridge in a .link unit. This would be very useful for
>>> macvlans as well.
>>
>> Link files can match bridges generally with Type=bridge or Driver=bridge
>> in the [Match] section, or more specifically by just matching on name.
>> In the [Link] section, MACAddressPolicy=persistent should give you
>> persistent hw addresses in the general case, or you can use
>> MACAddress=fe:ed:fa:ce:be:ef to set whatever you like for more specific
>> matches.
>>
>> Does this not work for you?
> Hmm, I thought I tried that before, but using
> MACAddress=fe:ed:fa:ce:be:ef seems to work now. Please note that the
> Name= match is not documented in the systemd.link manpage.

I have to correct myself: The Name= match does not exist for .link
units. My testcase just seemed to work as a [Match] section only
consisting of a Name= match was considered an empty [Match] section and
matched on all devices...

This should really be added as AFAICT there is currently no way to match
on virtual devices like briges, TAP devices, batman-adv devices, etc...
which have neither a persistent MAC address nor an ID_PATH to match on.

> 
> MACAddressPolicy=persistent doesn't seem to have an effect on bridge
> devices though (with systemd 212), but I don't rely on that anyways.
> 
>>
>>> Am I missing something? If not, it would be great if such a feature
>>> could be added, either by providing a way to match for such netdevs in a
>>> .link unit, or just by allowing a [Link] section in the .netdev unit
>>> (which would be more concise in my opinion).
>>>
>>> Thanks,
>>> Matthias
>>>
>>
>>
>>
>>> ___
>>> systemd-devel mailing list
>>> systemd-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
>>
> 
> 
> 
> 
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-17 Thread Matthias Schiffer
On 04/17/2014 11:28 PM, Dave Reisner wrote:
> On Thu, Apr 17, 2014 at 11:02:11PM +0200, Matthias Schiffer wrote:
>> Hi,
>> I'd like to configure the MAC address of a bridge device statically (as
>> bridges tend to change their MAC address depending on the order the
>> ports are added on Linux otherwise), but there doesn't seem to be a way
>> to match for a bridge in a .link unit. This would be very useful for
>> macvlans as well.
> 
> Link files can match bridges generally with Type=bridge or Driver=bridge
> in the [Match] section, or more specifically by just matching on name.
> In the [Link] section, MACAddressPolicy=persistent should give you
> persistent hw addresses in the general case, or you can use
> MACAddress=fe:ed:fa:ce:be:ef to set whatever you like for more specific
> matches.
> 
> Does this not work for you?
Hmm, I thought I tried that before, but using
MACAddress=fe:ed:fa:ce:be:ef seems to work now. Please note that the
Name= match is not documented in the systemd.link manpage.

MACAddressPolicy=persistent doesn't seem to have an effect on bridge
devices though (with systemd 212), but I don't rely on that anyways.

> 
>> Am I missing something? If not, it would be great if such a feature
>> could be added, either by providing a way to match for such netdevs in a
>> .link unit, or just by allowing a [Link] section in the .netdev unit
>> (which would be more concise in my opinion).
>>
>> Thanks,
>> Matthias
>>
> 
> 
> 
>> ___
>> systemd-devel mailing list
>> systemd-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> 




signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] systemd-networkd: setting the MAC address for a .netdev unit?

2014-04-17 Thread Matthias Schiffer
Hi,
I'd like to configure the MAC address of a bridge device statically (as
bridges tend to change their MAC address depending on the order the
ports are added on Linux otherwise), but there doesn't seem to be a way
to match for a bridge in a .link unit. This would be very useful for
macvlans as well.

Am I missing something? If not, it would be great if such a feature
could be added, either by providing a way to match for such netdevs in a
.link unit, or just by allowing a [Link] section in the .netdev unit
(which would be more concise in my opinion).

Thanks,
Matthias



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Forgot break in switch? (+ PATCH)

2010-10-01 Thread Matthias Schiffer
 As I didn't get any comments on my last mail, I'm trying again, now
with a patch attached :-D

I don't know if this patch is correct or if there is any reason that
break is missing, but applying it fixes an assertion fail for me.
systemd hits the assertion in the default branch of the switch when I
have a failing timer unit and call daemon-reload.

On 09/29/2010 03:23 PM, Matthias Schiffer wrote:
>  Hi,
> the single semicolon in timer.c:433 (git ee95669) looks strange, was it
> meant to be a break?
>
> This causes systemd to crash at the assertion on my Arch system whenever
> I call daemon-reload (yes, I have some failing units, I haven't set up
> everything correctly for Arch yet; I think, this is connected to
> tmpwatch.timer, as I haven't installed tmpwatch). Putting a break there
> fixes this.
>
> Matthias
>
>
>
> ___
> systemd-devel mailing list
> systemd-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel

From ef8bbe4d198a842b184dc52ed4b3f3a5de32690b Mon Sep 17 00:00:00 2001
From: Matthias Schiffer 
Date: Tue, 28 Sep 2010 15:25:20 +0200
Subject: [PATCH] timer: Add missing break in switch

---
 src/timer.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/timer.c b/src/timer.c
index ff94b8c..0dcaad5 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -430,7 +430,7 @@ void timer_unit_notify(Unit *u, UnitActiveState new_state) {
 
 case TIMER_DEAD:
 case TIMER_FAILED:
-;
+break;
 
 default:
 assert_not_reached("Unknown timer state");
-- 
1.7.3.1



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Forgot break in switch?

2010-09-29 Thread Matthias Schiffer
 Hi,
the single semicolon in timer.c:433 (git ee95669) looks strange, was it
meant to be a break?

This causes systemd to crash at the assertion on my Arch system whenever
I call daemon-reload (yes, I have some failing units, I haven't set up
everything correctly for Arch yet; I think, this is connected to
tmpwatch.timer, as I haven't installed tmpwatch). Putting a break there
fixes this.

Matthias



signature.asc
Description: OpenPGP digital signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] [PATCH] Arch Linux: Don't crash because of double free when services are disabled in rc.conf

2010-09-27 Thread Matthias Schiffer
---
 src/service.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/service.c b/src/service.c
index 021bc86..c58536d 100644
--- a/src/service.c
+++ b/src/service.c
@@ -2731,6 +2731,7 @@ static int service_enumerate(Manager *m) {
 STRV_FOREACH(p, arch_daemons_split) {
 
 free(name);
+name = NULL;
 
 if (**p == '!') /* daemons prefixed with ! are 
disabled, so ignore them */
 continue;
-- 
1.7.3

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel