Commit 82e91ffe authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller
Browse files

[NET]: Turn nfmark into generic mark



nfmark is being used in various subsystems and has become
the defacto mark field for all kinds of packets. Therefore
it makes sense to rename it to `mark' and remove the
dependency on CONFIG_NETFILTER.

Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 0afc46c4
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -216,7 +216,7 @@ enum {
 *	@tail: Tail pointer
 *	@tail: Tail pointer
 *	@end: End pointer
 *	@end: End pointer
 *	@destructor: Destruct function
 *	@destructor: Destruct function
 *	@nfmark: Can be used for communication between hooks
 *	@mark: Generic packet mark
 *	@nfct: Associated connection, if any
 *	@nfct: Associated connection, if any
 *	@ipvs_property: skbuff is owned by ipvs
 *	@ipvs_property: skbuff is owned by ipvs
 *	@nfctinfo: Relationship of this skb to the connection
 *	@nfctinfo: Relationship of this skb to the connection
@@ -295,7 +295,6 @@ struct sk_buff {
#ifdef CONFIG_BRIDGE_NETFILTER
#ifdef CONFIG_BRIDGE_NETFILTER
	struct nf_bridge_info	*nf_bridge;
	struct nf_bridge_info	*nf_bridge;
#endif
#endif
	__u32			nfmark;
#endif /* CONFIG_NETFILTER */
#endif /* CONFIG_NETFILTER */
#ifdef CONFIG_NET_SCHED
#ifdef CONFIG_NET_SCHED
	__u16			tc_index;	/* traffic control index */
	__u16			tc_index;	/* traffic control index */
@@ -310,6 +309,7 @@ struct sk_buff {
	__u32			secmark;
	__u32			secmark;
#endif
#endif


	__u32			mark;


	/* These elements must be at the end, see alloc_skb() for details.  */
	/* These elements must be at the end, see alloc_skb() for details.  */
	unsigned int		truesize;
	unsigned int		truesize;
+4 −4
Original line number Original line Diff line number Diff line
@@ -25,13 +25,13 @@ static int ebt_target_mark(struct sk_buff **pskb, unsigned int hooknr,
	int action = info->target & -16;
	int action = info->target & -16;


	if (action == MARK_SET_VALUE)
	if (action == MARK_SET_VALUE)
		(*pskb)->nfmark = info->mark;
		(*pskb)->mark = info->mark;
	else if (action == MARK_OR_VALUE)
	else if (action == MARK_OR_VALUE)
		(*pskb)->nfmark |= info->mark;
		(*pskb)->mark |= info->mark;
	else if (action == MARK_AND_VALUE)
	else if (action == MARK_AND_VALUE)
		(*pskb)->nfmark &= info->mark;
		(*pskb)->mark &= info->mark;
	else
	else
		(*pskb)->nfmark ^= info->mark;
		(*pskb)->mark ^= info->mark;


	return info->target | -16;
	return info->target | -16;
}
}
+2 −2
Original line number Original line Diff line number Diff line
@@ -19,8 +19,8 @@ static int ebt_filter_mark(const struct sk_buff *skb,
	struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data;
	struct ebt_mark_m_info *info = (struct ebt_mark_m_info *) data;


	if (info->bitmask & EBT_MARK_OR)
	if (info->bitmask & EBT_MARK_OR)
		return !(!!(skb->nfmark & info->mask) ^ info->invert);
		return !(!!(skb->mark & info->mask) ^ info->invert);
	return !(((skb->nfmark & info->mask) == info->mark) ^ info->invert);
	return !(((skb->mark & info->mask) == info->mark) ^ info->invert);
}
}


static int ebt_mark_check(const char *tablename, unsigned int hookmask,
static int ebt_mark_check(const char *tablename, unsigned int hookmask,
+1 −1
Original line number Original line Diff line number Diff line
@@ -168,7 +168,7 @@ static void ebt_ulog_packet(unsigned int hooknr, const struct sk_buff *skb,
	if (ub->qlen == 1)
	if (ub->qlen == 1)
		skb_set_timestamp(ub->skb, &pm->stamp);
		skb_set_timestamp(ub->skb, &pm->stamp);
	pm->data_len = copy_len;
	pm->data_len = copy_len;
	pm->mark = skb->nfmark;
	pm->mark = skb->mark;
	pm->hook = hooknr;
	pm->hook = hooknr;
	if (uloginfo->prefix != NULL)
	if (uloginfo->prefix != NULL)
		strcpy(pm->prefix, uloginfo->prefix);
		strcpy(pm->prefix, uloginfo->prefix);
+2 −2
Original line number Original line Diff line number Diff line
@@ -473,8 +473,8 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask)
#endif
#endif
	C(protocol);
	C(protocol);
	n->destructor = NULL;
	n->destructor = NULL;
	C(mark);
#ifdef CONFIG_NETFILTER
#ifdef CONFIG_NETFILTER
	C(nfmark);
	C(nfct);
	C(nfct);
	nf_conntrack_get(skb->nfct);
	nf_conntrack_get(skb->nfct);
	C(nfctinfo);
	C(nfctinfo);
@@ -534,8 +534,8 @@ static void copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
	new->pkt_type	= old->pkt_type;
	new->pkt_type	= old->pkt_type;
	new->tstamp	= old->tstamp;
	new->tstamp	= old->tstamp;
	new->destructor = NULL;
	new->destructor = NULL;
	new->mark	= old->mark;
#ifdef CONFIG_NETFILTER
#ifdef CONFIG_NETFILTER
	new->nfmark	= old->nfmark;
	new->nfct	= old->nfct;
	new->nfct	= old->nfct;
	nf_conntrack_get(old->nfct);
	nf_conntrack_get(old->nfct);
	new->nfctinfo	= old->nfctinfo;
	new->nfctinfo	= old->nfctinfo;
Loading