svn commit: r235505 - projects/pf/head/sys/contrib/pf/net
Gleb Smirnoff
glebius at FreeBSD.org
Wed May 16 12:00:32 UTC 2012
Author: glebius
Date: Wed May 16 12:00:31 2012
New Revision: 235505
URL: http://svn.freebsd.org/changeset/base/235505
Log:
Remove rtlabel stuff, that isn't supported in FreeBSD.
Modified:
projects/pf/head/sys/contrib/pf/net/pf.c
projects/pf/head/sys/contrib/pf/net/pf_ioctl.c
projects/pf/head/sys/contrib/pf/net/pfvar.h
Modified: projects/pf/head/sys/contrib/pf/net/pf.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf.c Wed May 16 10:47:13 2012 (r235504)
+++ projects/pf/head/sys/contrib/pf/net/pf.c Wed May 16 12:00:31 2012 (r235505)
@@ -1788,8 +1788,6 @@ pf_addr_wrap_neq(struct pf_addr_wrap *aw
return (0);
case PF_ADDR_TABLE:
return (aw1->p.tbl != aw2->p.tbl);
- case PF_ADDR_RTLABEL:
- return (aw1->v.rtlabel != aw2->v.rtlabel);
default:
printf("invalid address type: %d\n", aw1->type);
return (1);
@@ -5045,67 +5043,6 @@ out:
return (ret);
}
-int
-pf_rtlabel_match(struct pf_addr *addr, sa_family_t af, struct pf_addr_wrap *aw,
- int rtableid)
-{
- struct sockaddr_in *dst;
-#ifdef INET6
- struct sockaddr_in6 *dst6;
- struct route_in6 ro;
-#else
- struct route ro;
-#endif
- int ret = 0;
-
- bzero(&ro, sizeof(ro));
- switch (af) {
- case AF_INET:
- dst = satosin(&ro.ro_dst);
- dst->sin_family = AF_INET;
- dst->sin_len = sizeof(*dst);
- dst->sin_addr = addr->v4;
- break;
-#ifdef INET6
- case AF_INET6:
- dst6 = (struct sockaddr_in6 *)&ro.ro_dst;
- dst6->sin6_family = AF_INET6;
- dst6->sin6_len = sizeof(*dst6);
- dst6->sin6_addr = addr->v6;
- break;
-#endif /* INET6 */
- default:
- return (0);
- }
-
- switch (af) {
-#ifdef INET6
- case AF_INET6:
- in6_rtalloc_ign(&ro, 0, rtableid);
- break;
-#endif
-#ifdef INET
- case AF_INET:
- in_rtalloc_ign((struct route *)&ro, 0, rtableid);
- break;
-#endif
- default:
- rtalloc_ign((struct route *)&ro, 0);
- break;
- }
-
- if (ro.ro_rt != NULL) {
-#if 0
- /* XXX_IMPORT: later */
- if (ro.ro_rt->rt_labelid == aw->v.rtlabel)
- ret = 1;
-#endif
- RTFREE(ro.ro_rt);
- }
-
- return (ret);
-}
-
#ifdef INET
static void
pf_route(struct mbuf **m, struct pf_rule *r, int dir, struct ifnet *oifp,
Modified: projects/pf/head/sys/contrib/pf/net/pf_ioctl.c
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Wed May 16 10:47:13 2012 (r235504)
+++ projects/pf/head/sys/contrib/pf/net/pf_ioctl.c Wed May 16 12:00:31 2012 (r235505)
@@ -161,9 +161,6 @@ VNET_DEFINE(struct pf_tags, pf_qids);
static u_int16_t tagname2tag(struct pf_tags *, char *);
static u_int16_t pf_tagname2tag(char *);
void tag_unref(struct pf_tags *, u_int16_t);
-static int pf_rtlabel_add(struct pf_addr_wrap *);
-static void pf_rtlabel_remove(struct pf_addr_wrap *);
-static void pf_rtlabel_copyout(struct pf_addr_wrap *);
#define DPFPRINTF(n, x) if (V_pf_status.debug >= (n)) printf x
@@ -410,8 +407,6 @@ pf_free_rule(struct pf_rule *rule)
pf_qid_unref(rule->pqid);
pf_qid_unref(rule->qid);
#endif
- pf_rtlabel_remove(&rule->src.addr);
- pf_rtlabel_remove(&rule->dst.addr);
pfi_dynaddr_remove(&rule->src.addr);
pfi_dynaddr_remove(&rule->dst.addr);
pf_tbladdr_remove(&rule->src.addr);
@@ -511,27 +506,6 @@ pf_tag_unref(u_int16_t tag)
tag_unref(&V_pf_tags, tag);
}
-static int
-pf_rtlabel_add(struct pf_addr_wrap *a)
-{
- /* XXX_IMPORT: later */
- return (0);
-}
-
-static void
-pf_rtlabel_remove(struct pf_addr_wrap *a)
-{
- /* XXX_IMPORT: later */
-}
-
-static void
-pf_rtlabel_copyout(struct pf_addr_wrap *a)
-{
- /* XXX_IMPORT: later */
- if (a->type == PF_ADDR_RTLABEL && a->v.rtlabel)
- strlcpy(a->v.rtlabelname, "?", sizeof(a->v.rtlabelname));
-}
-
#ifdef ALTQ
static u_int32_t
pf_qname2qid(char *qname)
@@ -845,9 +819,6 @@ pf_hash_rule_addr(MD5_CTX *ctx, struct p
PF_MD5_UPD(pfr, addr.v.a.addr.addr32);
PF_MD5_UPD(pfr, addr.v.a.mask.addr32);
break;
- case PF_ADDR_RTLABEL:
- PF_MD5_UPD(pfr, addr.v.rtlabelname);
- break;
}
PF_MD5_UPD(pfr, port[0]);
@@ -1011,7 +982,6 @@ pf_addr_copyout(struct pf_addr_wrap *add
{
pfi_dynaddr_copyout(addr);
pf_tbladdr_copyout(addr);
- pf_rtlabel_copyout(addr);
}
static int
@@ -1297,9 +1267,6 @@ pfioctl(struct cdev *dev, u_long cmd, ca
if (rule->logif >= PFLOGIFS_MAX)
error = EINVAL;
#endif
- if (pf_rtlabel_add(&rule->src.addr) ||
- pf_rtlabel_add(&rule->dst.addr))
- error = EBUSY;
if (pf_addr_setup(ruleset, &rule->src.addr, rule->af))
error = EINVAL;
if (pf_addr_setup(ruleset, &rule->dst.addr, rule->af))
@@ -1560,9 +1527,6 @@ pfioctl(struct cdev *dev, u_long cmd, ca
if (newrule->logif >= PFLOGIFS_MAX)
error = EINVAL;
#endif
- if (pf_rtlabel_add(&newrule->src.addr) ||
- pf_rtlabel_add(&newrule->dst.addr))
- error = EBUSY;
if (pf_addr_setup(ruleset, &newrule->src.addr, newrule->af))
error = EINVAL;
if (pf_addr_setup(ruleset, &newrule->dst.addr, newrule->af))
Modified: projects/pf/head/sys/contrib/pf/net/pfvar.h
==============================================================================
--- projects/pf/head/sys/contrib/pf/net/pfvar.h Wed May 16 10:47:13 2012 (r235504)
+++ projects/pf/head/sys/contrib/pf/net/pfvar.h Wed May 16 12:00:31 2012 (r235505)
@@ -118,7 +118,7 @@ enum { PF_LIMIT_STATES, PF_LIMIT_SRC_NOD
enum { PF_POOL_NONE, PF_POOL_BITMASK, PF_POOL_RANDOM,
PF_POOL_SRCHASH, PF_POOL_ROUNDROBIN };
enum { PF_ADDR_ADDRMASK, PF_ADDR_NOROUTE, PF_ADDR_DYNIFTL,
- PF_ADDR_TABLE, PF_ADDR_RTLABEL, PF_ADDR_URPFFAILED,
+ PF_ADDR_TABLE, PF_ADDR_URPFFAILED,
PF_ADDR_RANGE };
#define PF_POOL_TYPEMASK 0x0f
#define PF_POOL_STICKYADDR 0x20
@@ -160,9 +160,6 @@ struct pf_addr_wrap {
} a;
char ifname[IFNAMSIZ];
char tblname[PF_TABLE_NAME_SIZE];
-#define RTLABEL_LEN 32 /* XXX_porting */
- char rtlabelname[RTLABEL_LEN];
- u_int32_t rtlabel;
} v;
union {
struct pfi_dynaddr *dyn;
@@ -396,8 +393,6 @@ extern struct rwlock pf_rules_lock;
pf_routable((x), (af), NULL, (rtid))) || \
(((aw)->type == PF_ADDR_URPFFAILED && (ifp) != NULL && \
pf_routable((x), (af), (ifp), (rtid))) || \
- ((aw)->type == PF_ADDR_RTLABEL && \
- !pf_rtlabel_match((x), (af), (aw), (rtid))) || \
((aw)->type == PF_ADDR_TABLE && \
!pfr_match_addr((aw)->p.tbl, (x), (af))) || \
((aw)->type == PF_ADDR_DYNIFTL && \
@@ -1895,8 +1890,6 @@ u_int32_t
void pf_purge_expired_fragments(void);
int pf_routable(struct pf_addr *addr, sa_family_t af, struct pfi_kif *,
int);
-int pf_rtlabel_match(struct pf_addr *, sa_family_t, struct pf_addr_wrap *,
- int);
int pf_socket_lookup(int, struct pf_pdesc *);
struct pf_state_key *pf_alloc_state_key(int);
void pfr_initialize(void);
More information about the svn-src-projects
mailing list