#else if (pf == PF_BRIDGE) { /* Case 1: outdev is physical output device, we need to * look for bridge group (when called from * netfilter_bridge) */ NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSOUTDEV, sizeof(tmp_uint), &tmp_uint); /* this is the bridge group "brX" */ tmp_uint = htonl(outdev->br_port->br->dev->ifindex); NFA_PUT(inst->skb, NFULA_IFINDEX_OUTDEV, sizeof(tmp_uint), &tmp_uint); } else { /* Case 2: indev is a bridge group, we need to look * for physical device (when called from ipv4) */ NFA_PUT(inst->skb, NFULA_IFINDEX_OUTDEV, sizeof(tmp_uint), &tmp_uint); if (skb->nf_bridge) { tmp_uint = htonl(skb->nf_bridge->physoutdev->ifindex); NFA_PUT(inst->skb, NFULA_IFINDEX_PHYSOUTDEV, sizeof(tmp_uint), &tmp_uint); } } #endif 
__build_packet_message(struct nfulnl_instance *inst,			const struct sk_buff *skb, 			unsigned int data_len,			unsigned int pf,			unsigned int hooknum,			const struct net_device *indev,			const struct net_device *outdev,			const struct nf_loginfo *li,			const char *prefix){	unsigned char *old_tail;	struct nfulnl_msg_packet_hdr pmsg;	struct nlmsghdr *nlh;	struct nfgenmsg *nfmsg;	u_int32_t tmp_uint;	UDEBUG("entered\n");			old_tail = inst->skb->tail;	nlh = NLMSG_PUT(inst->skb, 0, 0, 			NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET,			sizeof(struct nfgenmsg));	nfmsg = NLMSG_DATA(nlh);	nfmsg->nfgen_family = pf;	nfmsg->version = NFNETLINK_V0;	nfmsg->res_id = htons(inst->group_num);	pmsg.hw_protocol	= htons(skb->protocol);	pmsg.hook		= hooknum;	NFA_PUT(inst->skb, NFULA_PACKET_HDR, sizeof(pmsg), &pmsg);	if (prefix) {		int slen = strlen(prefix);		if (slen > NFULNL_PREFIXLEN)			slen = NFULNL_PREFIXLEN;		NFA_PUT(inst->skb, NFULA_PREFIX, slen, prefix);	}	if (indev) {		tmp_uint = htonl(indev->ifindex);		NFA_PUT(inst->skb, NFULA_IFINDEX_INDEV, sizeof(tmp_uint),			&tmp_uint);	}	if (outdev) {		tmp_uint = htonl(outdev->ifindex);		NFA_PUT(inst->skb, NFULA_IFINDEX_OUTDEV, sizeof(tmp_uint),			&tmp_uint);	}	if (skb->nfmark) {		tmp_uint = htonl(skb->nfmark);		NFA_PUT(inst->skb, NFULA_MARK, sizeof(tmp_uint), &tmp_uint);	}	if (indev && skb->dev && skb->dev->hard_header_parse) {		struct nfulnl_msg_packet_hw phw;		phw.hw_addrlen = 			skb->dev->hard_header_parse((struct sk_buff *)skb, 						    phw.hw_addr);		phw.hw_addrlen = htons(phw.hw_addrlen);		NFA_PUT(inst->skb, NFULA_HWADDR, sizeof(phw), &phw);	}	if (skb->stamp.tv_sec) {		struct nfulnl_msg_packet_timestamp ts;		ts.sec = cpu_to_be64(skb->stamp.tv_sec);		ts.usec = cpu_to_be64(skb->stamp.tv_usec);		NFA_PUT(inst->skb, NFULA_TIMESTAMP, sizeof(ts), &ts);	}	/* UID */	if (skb->sk) {		read_lock_bh(&skb->sk->sk_callback_lock);		if (skb->sk->sk_socket && skb->sk->sk_socket->file) {			u_int32_t uid = htonl(skb->sk->sk_socket->file->f_uid);			/* need to unlock here since NFA_PUT may goto */			read_unlock_bh(&skb->sk->sk_callback_lock);			NFA_PUT(inst->skb, NFULA_UID, sizeof(uid), &uid);		} else			read_unlock_bh(&skb->sk->sk_callback_lock);	}	if (data_len) {		struct nfattr *nfa;		int size = NFA_LENGTH(data_len);		if (skb_tailroom(inst->skb) < (int)NFA_SPACE(data_len)) {			printk(KERN_WARNING "nfnetlink_log: no tailroom!\n");			goto nlmsg_failure;		}		nfa = (struct nfattr *)skb_put(inst->skb, NFA_ALIGN(size));		nfa->nfa_type = NFULA_PAYLOAD;		nfa->nfa_len = size;		if (skb_copy_bits(skb, 0, NFA_DATA(nfa), data_len))			BUG();	}			nlh->nlmsg_len = inst->skb->tail - old_tail;	return 0;nlmsg_failure:	UDEBUG("nlmsg_failure\n");nfattr_failure:	PRINTR(KERN_ERR "nfnetlink_log: error creating log nlmsg\n");	return -1;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/fbcd923c3e0c8ec9e4ed64f5a4e5766807b32729/nfnetlink_log.c/buggy/net/netfilter/nfnetlink_log.c