summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-06 18:00:26 +0200
committerAnthony G. Basile <blueness@gentoo.org>2014-04-07 08:35:31 -0400
commitbd255c361d21b1acc116eba2fa2f02f2fa692641 (patch)
treed185cba0bfcd25d6b916443c5adc97ff63e791e8
parent4b76ac0bff27c0a32fc22591ec4543768ae5b991 (diff)
udev: net_id - use constants rather than magic numbers
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-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 92308ce615..ae3b6459f7 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: