2014-07-23 11:23:13 +02:00
|
|
|
Index: systemd-210/src/udev/rule_generator/write_net_rules
|
|
|
|
===================================================================
|
|
|
|
--- systemd-210.orig/src/udev/rule_generator/write_net_rules
|
|
|
|
+++ systemd-210/src/udev/rule_generator/write_net_rules
|
|
|
|
@@ -89,6 +89,12 @@ choose_rules_file
|
|
|
|
|
|
|
|
# the DRIVERS key is needed to not match bridges and VLAN sub-interfaces
|
|
|
|
if [ "$MATCHADDR" ]; then
|
|
|
|
+ # Check if MACADDR doesn't exist already in the generated rules
|
|
|
|
+ MAC="$(/usr/bin/grep -w -o -C1 -m1 "$MATCHADDR" "$RULES_FILE" 2>/dev/null || true)"
|
2014-11-19 10:32:26 +01:00
|
|
|
+ if [ "$MAC" = "$MATCHADDR" ]; then
|
2014-07-23 11:23:13 +02:00
|
|
|
+ unlock_rules_file
|
|
|
|
+ exit 0
|
|
|
|
+ fi
|
|
|
|
match="$match, DRIVERS==\"?*\", ATTR{address}==\"$MATCHADDR\""
|
|
|
|
fi
|
|
|
|
|
|
|
|
@@ -101,8 +107,9 @@ if [ "$MATCHDEVID" ]; then
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$MATCHID" ]; then
|
|
|
|
- ID="$(find_all_rules 'KERNELS==' "$MATCHID")"
|
|
|
|
- if [ "$ID" == "$MATCHID" ]; then
|
|
|
|
+ # Check if KERNEL doesn't exist already in the generated rules
|
|
|
|
+ KERNEL="$(find_all_rules 'KERNELS==' "$MATCHID")"
|
2014-11-19 10:32:26 +01:00
|
|
|
+ if [ "$KERNEL" = "$MATCHID" ]; then
|
2014-07-23 11:23:13 +02:00
|
|
|
unlock_rules_file
|
|
|
|
exit 0
|
|
|
|
fi
|