diff options
author | Henning Brauer <henning@cvs.openbsd.org> | 2005-06-06 03:44:22 +0000 |
---|---|---|
committer | Henning Brauer <henning@cvs.openbsd.org> | 2005-06-06 03:44:22 +0000 |
commit | 42ba9223f73995359f5c72a8206c6ad5b2235895 (patch) | |
tree | e61e7f6ee3cfcd5daf74702a28f1c35c9f4315fe /sys | |
parent | cfc46b08f15b5103c1172bd42c8d57fcfcadde63 (diff) |
use a define instead of hardcoding "all" in 3 places
Diffstat (limited to 'sys')
-rw-r--r-- | sys/net/if.c | 4 | ||||
-rw-r--r-- | sys/net/if.h | 5 | ||||
-rw-r--r-- | sys/net/pf_if.c | 6 |
3 files changed, 9 insertions, 6 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 8df2777fa5c..75cfe0d3703 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.125 2005/06/06 03:05:05 henning Exp $ */ +/* $OpenBSD: if.c,v 1.126 2005/06/06 03:44:21 henning Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -248,7 +248,7 @@ if_attachsetup(struct ifnet *ifp) TAILQ_INIT(&ifp->if_groups); - if_addgroup(ifp, "all"); + if_addgroup(ifp, IFG_ALL); ifindex2ifnet[if_index] = ifp; diff --git a/sys/net/if.h b/sys/net/if.h index 6b69d4cfa73..96a8f974b7e 100644 --- a/sys/net/if.h +++ b/sys/net/if.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if.h,v 1.71 2005/06/05 20:49:25 henning Exp $ */ +/* $OpenBSD: if.h,v 1.72 2005/06/06 03:44:21 henning Exp $ */ /* $NetBSD: if.h,v 1.23 1996/05/07 02:40:27 thorpej Exp $ */ /* @@ -424,6 +424,9 @@ struct if_announcemsghdr { /* * interface groups */ + +#define IFG_ALL "all" /* group containing all interfaces */ + struct ifg_group { char ifg_group[IFNAMSIZ]; u_int ifg_refcnt; diff --git a/sys/net/pf_if.c b/sys/net/pf_if.c index a84f0aacb63..9638b1a29d0 100644 --- a/sys/net/pf_if.c +++ b/sys/net/pf_if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pf_if.c,v 1.38 2005/06/05 20:47:46 henning Exp $ */ +/* $OpenBSD: pf_if.c,v 1.39 2005/06/06 03:44:21 henning Exp $ */ /* * Copyright 2005 Henning Brauer <henning@openbsd.org> @@ -95,7 +95,7 @@ pfi_initialize(void) pfi_buffer = malloc(pfi_buffer_max * sizeof(*pfi_buffer), PFI_MTYPE, M_WAITOK); - if ((pfi_all = pfi_kif_get("all")) == NULL) + if ((pfi_all = pfi_kif_get(IFG_ALL)) == NULL) panic("pfi_kif_get for pfi_all failed"); } @@ -347,7 +347,7 @@ pfi_dynaddr_setup(struct pf_addr_wrap *aw, sa_family_t af) s = splsoftnet(); if (!strcmp(aw->v.ifname, "self")) - dyn->pfid_kif = pfi_kif_get("all"); + dyn->pfid_kif = pfi_kif_get(IFG_ALL); else dyn->pfid_kif = pfi_kif_get(aw->v.ifname); if (dyn->pfid_kif == NULL) { |