diff options
author | Tom Gundersen <teg@jklm.no> | 2014-04-06 18:00:26 +0200 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2014-04-07 08:35:31 -0400 |
commit | bd255c361d21b1acc116eba2fa2f02f2fa692641 (patch) | |
tree | d185cba0bfcd25d6b916443c5adc97ff63e791e8 | |
parent | 4b76ac0bff27c0a32fc22591ec4543768ae5b991 (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.c | 5 |
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: |