summaryrefslogtreecommitdiff
path: root/src/udev/udev-builtin-net_id.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-06 18:00:26 +0200
committerTom Gundersen <teg@jklm.no>2014-04-06 18:00:40 +0200
commit19aa72f74e41045510b4af3f1415b419d42ff20b (patch)
tree0762087ea8358c87d7cc4703ad51d307bcc835b7 /src/udev/udev-builtin-net_id.c
parent609211792b83267ca202b40f25d1755a004c8c96 (diff)
udev: net_id - use constants rather than magic numbers
Diffstat (limited to 'src/udev/udev-builtin-net_id.c')
-rw-r--r--src/udev/udev-builtin-net_id.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/udev/udev-builtin-net_id.c b/src/udev/udev-builtin-net_id.c
index aa08196adb..c80c30ac77 100644
--- a/src/udev/udev-builtin-net_id.c
+++ b/src/udev/udev-builtin-net_id.c
@@ -94,6 +94,7 @@
#include <string.h>
#include <errno.h>
#include <net/if.h>
+#include <net/if_arp.h>
#include <linux/pci_regs.h>
#include "udev.h"
@@ -451,10 +452,10 @@ static int builtin_net_id(struct udev_device *dev, int argc, char *argv[], bool
return EXIT_FAILURE;
i = strtoul(s, NULL, 0);
switch (i) {
- case 1: /* ARPHRD_ETHER */
+ case ARPHRD_ETHER:
prefix = "en";
break;
- case 256: /* ARPHRD_SLIP */
+ case ARPHRD_SLIP:
prefix = "sl";
break;
default: